GUI questions
by Andrei Esca · in Torque Developer Network · 04/04/2011 (3:43 pm) · 4 replies
Greetings everyone,
I am new to TGB and I downloaded the Torque2D and currently trying to figure out the GUI tutorials.
It seems that this documentation is not updated and I read a lot of old threads about this and none seem to answer my problems.
My problems are...
1. How do I make the scoreboard GUI work? In the tutorial there is a profile but I cannot get it to load. I also tried creating my custom profile which only contains modal=false; but it crashes my TBG
2. Is there a way to pause the game when a menu pops up? What I am trying to do is like if a player levels up, a screen pops up showing an option to upgrade his stats (health, damage, speed, etc) but also pause the game in the background.
3. Are there any other updated tutorials around? Most of the tutorials I see are dated 2009 and earlier.
Thank you all in advance
-Andrei
I am new to TGB and I downloaded the Torque2D and currently trying to figure out the GUI tutorials.
It seems that this documentation is not updated and I read a lot of old threads about this and none seem to answer my problems.
My problems are...
1. How do I make the scoreboard GUI work? In the tutorial there is a profile but I cannot get it to load. I also tried creating my custom profile which only contains modal=false; but it crashes my TBG
2. Is there a way to pause the game when a menu pops up? What I am trying to do is like if a player levels up, a screen pops up showing an option to upgrade his stats (health, damage, speed, etc) but also pause the game in the background.
3. Are there any other updated tutorials around? Most of the tutorials I see are dated 2009 and earlier.
Thank you all in advance
-Andrei
#3
04/06/2011 (4:37 pm)
yes Andrei we appreciate if you can share your solutions
#4
1. This is what I did, open games/<myGame>/game/gameScripts/guiProfiles.cs then enter these
Then create a new GUI and create a control (ex. textboxcontrol or button control). then set the GuiControl (the VERY first one in the heirarchy) to ExampleModeless. Follow the rest of the tutorial
2. I lost my previous codes for the pause and I cannot find the forum thread where I found my answer. So I just created a function
04/12/2011 (11:55 pm)
Sorry for late reply, I don't read the forums anymore.1. This is what I did, open games/<myGame>/game/gameScripts/guiProfiles.cs then enter these
if (!isObject(ExampleModeless)) new GuiControlProfile(ExampleModeless)
{
modal = false;
};Then create a new GUI and create a control (ex. textboxcontrol or button control). then set the GuiControl (the VERY first one in the heirarchy) to ExampleModeless. Follow the rest of the tutorial
2. I lost my previous codes for the pause and I cannot find the forum thread where I found my answer. So I just created a function
function pauseGame()
{
if ($timescale==0)
{
$timescale=1;
}
else
{
$timescale=0;
}
}
Andrei Esca