Making a GUI Window appear from Left to Right...
by Corin · in Torque Game Engine · 05/19/2005 (4:25 am) · 6 replies
About the author
#2
For one, your for loop doesn't include setting hte position... For 2, you have to exit the function before it will render the gui (don't you?)
I could be wrong, but I highly doubt that will work.
Something like this might... Though I think I got the Schedule syntax wrong.
05/19/2005 (4:33 am)
I don't think your loop will do anything, short of moving the gui control to the final position of (100, 100)For one, your for loop doesn't include setting hte position... For 2, you have to exit the function before it will render the gui (don't you?)
I could be wrong, but I highly doubt that will work.
Something like this might... Though I think I got the Schedule syntax wrong.
function moveIt(%dist)
{
MyWindow.position += 1;
if (%dist > 0)
{
schedule(20,moveIt,0,%dist - 1); // This might not be the right syntax
}
}
#3
05/20/2005 (4:03 pm)
You gotta do some coding, buddy. We built GuiAnimatedCtrl for our projects. It isn't perfect, but it's suitable for what you want, but I need to get some authorization before checking it in as a resource or posting it up.
#4
05/26/2005 (2:30 pm)
Instead of this MyWindow.position += 1;try
%pos = MyWindow.position; %posx = getWord(%pos, 0); %posy = getWord(%pos, 1); %posx += 1; %newpos = %posx SPC %posy; MyWindow.position = %newpos; //might see if there is a MyWindow.setPostion(%newpos);
#5
note this little console function
05/26/2005 (2:40 pm)
After looking at guicontrol.h/.ccnote this little console function
/// Changes the size and/or position of this control
/// @param newPosition New position of this control
/// @param newExtent New size of this control
virtual void resize(const Point2I &newPosition, const Point2I &newExtent);
ConsoleMethod( GuiControl, resize, void, 6, 6, "(int x, int y, int w, int h)")
{
}
#6
06/26/2009 (1:36 am)
I did not understan what this code does in Gui?
Torque Owner Markus Nuebel
E.g.
This should position the window at screen position (100, 100);
Try to animate the x-position in a loop, e.g.
which will make your UI stall, since there are no mouse events between the window animation,
or use the schedule() method, to do the x-pos animation.
-- Markus