Loading a level for a UI menu
by Konrad Carstein · in Torque Game Builder · 01/06/2009 (9:01 am) · 3 replies
I'm creating a simple menu in the game when the user presses the escape key. I'm not using an actual GUI created in the GUI builder. I'm simply loading a level file into a scene window that in laying on top of the game.
When they press escape, I load it, and when they press escape again I end the level.
Here are a few questions if anybody can offer me some guidiance.
1. I'm using this method because I just get the impression that using levels and button behaviors is a more common way then creating and actual GUI. Am I wrong?
2. This method seems to work fine, but are there issues with it? Is the process of loading a small level file too much overhead?
Thanks for any feedback. For some reason, a simple task such as being able to press escape to bring up a quit menu, seems to have a few ways of doing it. I'm just looking for how most TGB users handle these types of simple menus.
Thanks
When they press escape, I load it, and when they press escape again I end the level.
Here are a few questions if anybody can offer me some guidiance.
1. I'm using this method because I just get the impression that using levels and button behaviors is a more common way then creating and actual GUI. Am I wrong?
2. This method seems to work fine, but are there issues with it? Is the process of loading a small level file too much overhead?
Thanks for any feedback. For some reason, a simple task such as being able to press escape to bring up a quit menu, seems to have a few ways of doing it. I'm just looking for how most TGB users handle these types of simple menus.
Thanks
#2
01/07/2009 (5:07 am)
Thanks for the feedback.
#3
01/08/2009 (6:38 am)
There are plenty of benefits Konrad. You have more control over the look and feel of the menus, they are easier to edit (IMHO), you can do "special effects" like fading much more easily. Plus when the menus are built with sceneobjects theres no screwing with .gui files or any of that nonsense. I made all of my menus for my current project as levels inside the level editor. I doubt I'd be able to do what I did using the built in GUI system.
Torque Owner Gary Preston
I don't know if it's a more common way, but it's certainly just as valid a way imo.
One option for this is to create scene graphs for commonly used menus and keep them in a global. Then when you want to active a menu, you just pause the current scene graph and set the scene window to the new scene graph. That allows you to only have to load each menu level once from disk.
Whether you pre-load the menus or do it in an on demand way is up to you. Also which menus you keep around all the time and which you delete will depend upon how much memory each scene graph uses and how often a player will enter the menus.
This is an approach I used a month or so ago in a TGB game. It had the added advantage that it's easy to do fly-in/fly-out screen transitions.