Game Development Community

Gui Problems

by Storm Kiernan · in Torque Game Builder · 11/12/2011 (8:01 pm) · 4 replies

I have a game board, with GUI on the side. The idea is that the gui remains on the side while the player can choose different cells on the board. The problem is simple: when the gui is up, the cells on the board cant be selected as usual. How do I solve this? I have already tried modifying the extent.

#1
11/13/2011 (7:07 pm)
A very simple way is to set a global variable ($GUI_UP = true/false) and check it when events come in for the board's cells. If it's set, just return out the function early.

If the GUI is a .gui file, then you can have a GUIControl that contains your GUI. The GUIControl's Horiz/Vertical Sizing would be set to "width" and "height" respectively. Make sure the profile for the GUIControl is set so that "modal = true". This will prevent mouse presses from going through to the underlying t2dSceneWindow.
#2
11/13/2011 (8:14 pm)
I think I may not have been clear enough. My problem is that I DO need to click through the GUI, but I cannot. The GUI is somehow blocking (although not visually) the ability to click the game board.
#3
11/13/2011 (11:50 pm)
Scene window is a GUI control itself; when it's behind it'll not receive any input - just like with any windows system, it is delivered to the topmost window only.

You have to decide first where's border between ingame HUD and settings-menus in your game will go. Simple controls and essential information that should always be present on the screen can be built out of sprites and other scene objects, you'll also get much more control on how it looks and behaves this way. Rarely used and more heavy stuff then, with all tabs, lists, sliders and other controls can be made into modal GUI dialogues.
#4
11/14/2011 (8:17 am)
OK. That will be easy enough. Thank you!

####EDIT#####
By the way, I got my original plan to work. After you told me the scene window was a GUI, I located the GUI file for it and placed my GUI definitions in that file.