Game Development Community

Problems Using Multiple GUIs

by USC - IMD student 2 · in Torque Game Builder · 01/07/2008 (4:17 am) · 4 replies

Hi,

I'm trying to create a GUI for my main menu, but it's causing problems. the GUI for the main menu works fine, but when I try to start a level, it just shows the Torque Game Builder logo. I know the game is running in the background, because I can hear the sounds, but I just can't see anything that it's supposed to show. when attempting to isolate the problem, I noticed that when I don't include (exec) the .gui file for the main menu, the levels work fine. seems like Torque doesn't like it when I use multiple .gui files, which doesn't make sense. I'm using v1.1.3. any ideas??

-Waylon

#1
01/07/2008 (4:54 am)
How do you load the level up? You probably are just missing out the line where you set the canvas to the level GUI instead of the menu GUI.
#2
01/08/2008 (12:07 am)
This is how i set everything up in game.cs...

// Set The GUI.
Canvas.setContent(mainScreenGui);
Canvas.setCursor(DefaultCursor);

Canvas.pushDialog(titleGui); // load GUI for Title Screen

if( isFile( %level ) || isFile( %level @ ".dso"))
sceneWindow2D.loadLevel(%level); // starts on Title Screen

this is how I'm loading the first level from the title screen...

Canvas.popDialog(titleGui); // unload GUI for Title Screen
sceneWindow2D.loadLevel("B17/data/levels/level1.t2d"); // load Level 1
#3
01/08/2008 (5:36 pm)
SceneWindow2D.loadLevel(%level); // starts on Title Screen

Does this line mean that the titleGui has a sceneWindow2D in it, or is that just a holdover from the original startGame? If you have two objects called sceneWindow2D (on different GUIs), they'll conflict with each-other.
#4
01/08/2008 (6:11 pm)
Oic, that might be it then. the first time I call sceneWindow2D.loadLevel is from the original startGame code, but the second time i call it is my own code. maybe i'm changing levels incorrectly.