View Single Post
02-19-18, 06:09 AM   #31
lightspark
A Rage Talon Dragon Guard
 
lightspark's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2012
Posts: 341
Originally Posted by Coldkil View Post
Anyway it looks simple enough to fix - every bar will use a static page and that's it.
Well, main action bar isn't static, its page changes depending on your stance/form/etc.

Originally Posted by Coldkil View Post
Also, tip on how to "cut" a texture via SetTextCoords?


Let's say you have a 256x128 texture, and you want to use a 32x32 piece that's offset from the top left corner by 8px.

This piece's coords will be: 8 / 256, (8 + 32) / 256, 8 / 128, (8 + 32) / 128. It's pretty straight froward.

I use PS, so I run this ghetto JS script I wrote years ago:
Code:
var doc = app.activeDocument;

function hasSelection() {
    try {
        return (doc.selection.bounds) ? true : false;
    } catch (e) {
        return false;
    }
}

if (hasSelection()) {
    var win = new Window("dialog {\
        alignChildren: 'fill',\
        preferredSize: [256, 32],\
        margins: 6,\
        text: 'Selection Coords',\
        ed: EditText {\
            active: true,\
        },\
    }");
    win.ed.text =
        doc.selection.bounds[0].value + " / " + doc.width.value + ", " +
        doc.selection.bounds[2].value + " / " + doc.width.value + ", " +
        doc.selection.bounds[1].value + " / " + doc.height.value + ", " +
        doc.selection.bounds[3].value + " / " + doc.height.value;
    win.center();
    win.show();
}
Just create a new action that runs this script.

__________________

Last edited by lightspark : 02-19-18 at 07:04 AM.
  Reply With Quote