View Full Version : Gui problem, help please

09-09-2007, 11:55 PM
I'm new to the GuiCtrl functions and i am having a big problem.
function onCreated(){
new GuiShowImgCtrl("Main_Gui") {
x = 2;
y = 0;
width = 226;
height = 91;
image ="metric_gui1.png";
new GuiShowImgCtrl("Hotkey_Gui") {
x = 2;
y = 489;
width = 365;
height = 43;
image ="metric_gui1.png";
function stats()
showstats(0x400 | 0x800);
Main_Gui works but Hotkey_Gui doesn't. I've been trying to find a function that will let me put the x and y of the image so that it will show the right part of the image.

09-10-2007, 01:45 AM
Fixed over AIM.

09-10-2007, 04:41 AM
Fixed over AIM.

Could you explain to us what was incorrect about it, for the greater good? :)

09-10-2007, 05:46 AM
instead of using x and y, you use
position = {x,y};
and instead of width and height use
extent = {w,h};
and when you add another GuiShowImg you should use
offsetx = x; (of the image)
offsety = y;
^ is the same as offsetx just its the y. And it is a negative!

09-10-2007, 06:32 AM
Well for the extent and position thing, thats just the recommended thing. x, y, width, and height still work but they're really just reflections of extent and position.

offsetx and offsety are the x and y of the image inside the GUI Control relative to the GUI control itself. So having an offsetx of -32 means the Image inside the GUI Control with be moved 32 pixels to the left of the GUI Control. Only the part of the image inside the GUI Control area actually shows.