Changing gui(s)
by James Ford · in Torque Game Builder · 04/24/2006 (8:05 am) · 6 replies
I have a main menu gui, which has a start game button. When clicked I want to load the "in game" gui. So, when the button is clicked it does:
function startgame()
{
canvas.setcontent(ingame);
new t2dscenegraph(scenegraph2d);
etc...
createplayer();
createkeybinds();
etc...
}
And of course at the top of main.cs i have "exec(~/guis/ingame.gui);
But the start game / quit game buttons are staying on the screen (although you can still play the game). Im not getting any errors, but its not doing what i want... help?
function startgame()
{
canvas.setcontent(ingame);
new t2dscenegraph(scenegraph2d);
etc...
createplayer();
createkeybinds();
etc...
}
And of course at the top of main.cs i have "exec(~/guis/ingame.gui);
But the start game / quit game buttons are staying on the screen (although you can still play the game). Im not getting any errors, but its not doing what i want... help?
About the author
http://jamesdev.info
#2
04/25/2006 (11:43 am)
I think they are part of the mainmenu/screen gui. I created the buttons in the GUI editor and saved it as mainscreen.gui. In the file mainscreen.gui, the buttons are listed/created there. Which means if I change the gui (canvas.setcontent) they should dissapear, right ?
#3
After that make sure that you can load each one individually (load the mainscreengui and make sure it's working, then comment that line out and load the startupscreen gui). If both still work fine, then you can start trying to get the toggling to work. The reason I say this is because I messed up something when adding the second gui and thought it was the toggling that was messing me up when actually the game gui wasn't loading at all.
EDIT *big one!* added "ONE for each gui", not 2 scenegraphs per gui but 2 scenegraphs and 2 guis
04/26/2006 (2:00 pm)
I had the same problem what I did to solve it was to make sure that I had 2 scenegraphs, ONE for each gui. Then cleared the other scenegraph when you started the game.After that make sure that you can load each one individually (load the mainscreengui and make sure it's working, then comment that line out and load the startupscreen gui). If both still work fine, then you can start trying to get the toggling to work. The reason I say this is because I messed up something when adding the second gui and thought it was the toggling that was messing me up when actually the game gui wasn't loading at all.
EDIT *big one!* added "ONE for each gui", not 2 scenegraphs per gui but 2 scenegraphs and 2 guis
#4
my e-mail is
mattl (at) garagegames.com
04/26/2006 (3:18 pm)
Feel free to e-mail me your working directory, I'll give it a look. my e-mail is
mattl (at) garagegames.com
#5
05/02/2006 (6:57 pm)
Did you get my email? I sent it about a week ago
#6
now it wont even load the mainscreen gui... or it does, but it doesnt have any of the buttons it is suppose to.
05/03/2006 (4:47 pm)
Nice tips WDDG, although im still working on itnow it wont even load the mainscreen gui... or it does, but it doesnt have any of the buttons it is suppose to.
Torque Owner Philip Mansfield
Default Studio Name
If they're imagemaps, you'll need to either delete them or hide.