Resolved - Using .isVisible and cant get buttons active
by Flybynight Studios · in Torque Game Engine · 07/16/2007 (12:26 am) · 2 replies
I will probably regret posting this tomorrow as my brain is done for tonight I Think but I cant get my head around what Im doing wrong..
At this point I'v ebeen using .isvisible checks and switches to turn on and off my sub menus in the game. Things are great but now I'm gettign into phase 2 of the sub menus and I want to add buttons to the GUICntrls.. I cant get the buttons active.. Funny thing though I can click through the guttons and select targets and objects through the menu panel into the world view behind it.
I do not want to force the screen to only acknowledge buttons on the sub menus when they are up. It is important that the mouse be active on the main screen as well as the sub menu screens.
All my sub menu GUIs are child objects of the main playGui.
Main 3D world view - parent
Quest log - child
Inventory - child
Merchant - child
Quest Dialogue - child
Character info - child
Skill info - child
Ability info - child
etc. etc.
All of the above menus work great calling them with keybinds. Now I am just tidying up the submenus by installing buttons to turn on /off some visible settings. The turning on / off isnt the problem the problem is the buttons are not actively clickable.. They show up fine but I click through them to whatever object is behind the menu..
Thanks all
At this point I'v ebeen using .isvisible checks and switches to turn on and off my sub menus in the game. Things are great but now I'm gettign into phase 2 of the sub menus and I want to add buttons to the GUICntrls.. I cant get the buttons active.. Funny thing though I can click through the guttons and select targets and objects through the menu panel into the world view behind it.
I do not want to force the screen to only acknowledge buttons on the sub menus when they are up. It is important that the mouse be active on the main screen as well as the sub menu screens.
All my sub menu GUIs are child objects of the main playGui.
Main 3D world view - parent
Quest log - child
Inventory - child
Merchant - child
Quest Dialogue - child
Character info - child
Skill info - child
Ability info - child
etc. etc.
All of the above menus work great calling them with keybinds. Now I am just tidying up the submenus by installing buttons to turn on /off some visible settings. The turning on / off isnt the problem the problem is the buttons are not actively clickable.. They show up fine but I click through them to whatever object is behind the menu..
Thanks all
#2
In order to add a GUI element to the existing canvas (while still retaining the rest of the current canvas as active) you must getcontent().add(yourelement)
Example:
Hope this helps anyone else running into this. Just another small mystery in that great big question mark that is the GUI setup ;) Score one for the good guys.
07/22/2007 (12:25 pm)
Ok I finally had to come back to this because it was screwing over my progression into the questing and inventory modules. My gut feeling is that .visible didnt actually make the element active. After a little more digging and some testing it appears that is corect.In order to add a GUI element to the existing canvas (while still retaining the rest of the current canvas as active) you must getcontent().add(yourelement)
Example:
if(!charinfomain.isAwake())
{
Echo("Opening CHARINFOMAIN");
Canvas.getContent().Add(charinfomain);
}
else
{
Echo("Closing CHARINFOMAIN");
Canvas.getContent().Remove(charinfomain);
}Hope this helps anyone else running into this. Just another small mystery in that great big question mark that is the GUI setup ;) Score one for the good guys.
Torque Owner Flybynight Studios
Truely could use some feedback. Thanks
PS: What I am really trying to accomplish here is a nested data window inside a menu gui. The data window can be changed based on which button at the bototm of the menu window is activated..
PlayGui
- MenuGui
--First data window inside the MenuGui
--Second ...
-- Third ...
- Button to activate first data window
- Button to activate second data window
- ... third...
The effect here would be your typical MMO character info sheet with buttons at the bottom for stats, skills, equipment and factions.. Currently each of those features work great but I am activating each one with it's own keyboard action.. I would like to clean this up into a single character info GUI.
Thank you