Switching between multiple open dialogs
by James Ford · in Torque Game Builder · 08/10/2007 (7:45 pm) · 2 replies
The playscreen (gui) in my game has a menu bar which by selecting different menuitems will open various other guis with canvas.pushdialog, however, only one of these can be open at a time since once you do pushdialog the bottom gui, the playscreen, no longer receives any mouse input, until you close the pushed gui. What I would like is the ability to open multiple gui/dialogs with the menubar and then switch between them once they are open by clicking on the one I wish to pull to the front.
Any ideas on how to accomplish this?
If I could detect a mouse click on a "bottom" gui then i could repush it to put it on top, but I'm not sure if this is even possible with the way input is "routed" through the guis.
Maybe I could detect any mouse click event anywhere on the screen and then calculate what gui is under it manually... But how could i do this without interfering which whatever would normally happen when they click in that location? Like, if i just put a big button over the screen wouldn't that block ALL input? They still need the ability to interact with the gui, like selecting text lists, etc.
Another easy but un-user-friendly solution could be to bind different keys to pushing the various windows.
Perhaps I could keep the same main gui active all the time but substitute different sub-controls to achieve the same effect. When a menu item is selected to open a new window, it doesn't pushdialog, it just creates a new window control parented to the mainscreen. This seems like a promising solution, then all my data-windows would be siblings and all with a common parent and all should recieve input.
I believe I will continue working with my last idea, if any have a better idea drop me a post '-)
Any ideas on how to accomplish this?
If I could detect a mouse click on a "bottom" gui then i could repush it to put it on top, but I'm not sure if this is even possible with the way input is "routed" through the guis.
Maybe I could detect any mouse click event anywhere on the screen and then calculate what gui is under it manually... But how could i do this without interfering which whatever would normally happen when they click in that location? Like, if i just put a big button over the screen wouldn't that block ALL input? They still need the ability to interact with the gui, like selecting text lists, etc.
Another easy but un-user-friendly solution could be to bind different keys to pushing the various windows.
Perhaps I could keep the same main gui active all the time but substitute different sub-controls to achieve the same effect. When a menu item is selected to open a new window, it doesn't pushdialog, it just creates a new window control parented to the mainscreen. This seems like a promising solution, then all my data-windows would be siblings and all with a common parent and all should recieve input.
I believe I will continue working with my last idea, if any have a better idea drop me a post '-)
About the author
http://jamesdev.info
#2
12/09/2010 (2:58 pm)
Hate to necro this thread, but this is the exact problem I'm having. I posted this thread (http://www.torquepowered.com/community/forums/viewthread/123107) in an effort to find an answer, but no luck thus far. Is by some chance you happen to still be around James, how did you get other guis (which I assume have their own .gui file) to be children of your playGui?
Associate James Ford
Sickhead Games