Game Development Community

Changing position to a GuiControl realtime

by Christos Karapiperis · in Torque Game Builder · 10/23/2006 (2:56 am) · 3 replies

Hi,
I want to ask this: Is it possible to change the position of a GuiControl realtime? I want to popup a message every now and then but in different positions. I have managed to show it with the text message I want but I can't figure out how to set the position in screen. Functions like setPosition() don't seem to work. Thanks.

#1
10/28/2006 (3:10 pm)
You can control all the elements you have in the gui
use object.dump() to see the the gui control option you can control position like this:

somegui.position="55 66"
you can put string inside like this:

%x=55;
%y=66;

somegui.position=%x SPC %y

i think it should work
#2
10/28/2006 (8:09 pm)
Another very handy option is to attach a GuiControl to a static sprite:
$spriteVariable.attachGui( HUDName, sceneWindow2D );
This way, you get to do all the nice moveTo stuff with sprites. It's a great way to have a GUI smoothly appear from outside of the bounds of your scene; to wherever you want it to be.
#3
11/03/2006 (10:32 pm)
I would recommend Don's way... there is also the resize() function, do a .dump on the GUI object to get the parameters.