I'm trying to make a little rig GUI with a window containing a background image, and then a few buttons placed correctly to correspond to the controls on the rig.
I want to lock the size of the window, as I can't really figure out how to allow for scale, and then make everything scale relatively, so they remain positioned correctly - any tips on that?
Anyhow, I've lock the scale but for some reason I cannot control the size of the window, and it doesn't really match my background picture, making it appear stretched.
the code is like this:
//Make the window appear
int $windowWidth = 300;
int $windowHeight = 600;
string $w_title = "RigGUI";
if (`window -exists $w_title`)
-wh $windowWidth $windowHeight
-t "Rig GUI"
string $i = `image -i "GUIPose.bmp"`;
string $bLelbow = `button -label "" -w 20 -h 20 -bgc 0.3 0.3 .8 -c "LeftElbow()"`;
string $bLwrist = `button -label "" -w 20 -h 20 -bgc 0.3 0.3 .8 -c "LeftWrist()"`;
-af $i top 0 -af $i left 0 -af $i right 0 -af $i bottom 0
-af $bLelbow top 240 -an $bLelbow left -af $bLelbow right 90 -an $bLelbow bottom
-af $bLwrist top 320 -an $bLwrist left -af $bLwrist right 60 -an $bLwrist bottom
//Set window width and height
window -e -wh $windowWidth $windowHeight $w_title;
As you can tell, I'm not much af a scripter, so I just tried to piece it together by looking at examples and stuff.
The background picture is 300 by 600, so that is what I want my window to be as well.