Looking or some world editor and playgui advice
by Zach · in Torque Game Engine · 07/12/2005 (7:55 am) · 5 replies
I've recently begun playing with gui's and I love it. Torque's Gui editor is absolutely brilliant and very fun to work with. I've started a project that is going to take a significant amount of gui work and there is no way I'm going to be able to get through it without asking some questions.
First thing, here are a couple of screenshots that I'll be referring to:
(picture 1)

(picture 2)

I've managed to get play gui to render inside of a guiWindowProfile control but I'm running into a problem. Once I open a mission and playgui is running, whatever gui is behind it doesn't seem to get drawn anymore. Picture 2 shows what it looks like when I move my cursor over any part of the screen that is't in the playgui window. My guess is that once playgui starts up, it assumes that nothing needs to be drawn behind it. Looking through playgui.cs, I haven't been able to find anything that looks like it would be causing this. If anyone has an idea of where and what I should be looking for I would greatly appreciate it.
Ok, now secondly, this isn't really a problem but I'm looking for some advice on setting up mouse control in playgui. At the moment, when playgui starts up the cursor gets hidden and it becomes your control for being able to look around inside the play area. Once you press F11 the world editor pops up and the control becomes a little different. You get your cursor back and right clicking and dragging becomes your way of looking around.
What I'm trying to accomplish is making it so I'm able to toggle the mouse control in playgui without actually opening the world editor. I'd like to bind a key to be able to toggle the control from having no cursor, to having a cursor and getting the rotation to come from right clicking and dragging. (god I hope I'm making sense)
Anyways, it seems like the world editor is getting its mouse functionality from a preference inside of common\editor\EditorGui.cs. Anyone who has ever actually taken a look inside that particular script might agree with me that things are a bit overwhelming.
Specifically I'm looking for advice on where I should be looking for some idea on how to implement the mouse functionality from the world editor into playgui at the touch of a button. (actually key)
I'm usually pretty embarrassed and reluctant to ask for help but having this functionality is crucial to my project and the rest of the gui work I'll be doing over the next few months. Any help is greatly appreciated. I should really take the time to thank you for even reading this.
-Zach
edit: reversed the picture order
First thing, here are a couple of screenshots that I'll be referring to:
(picture 1)

(picture 2)

I've managed to get play gui to render inside of a guiWindowProfile control but I'm running into a problem. Once I open a mission and playgui is running, whatever gui is behind it doesn't seem to get drawn anymore. Picture 2 shows what it looks like when I move my cursor over any part of the screen that is't in the playgui window. My guess is that once playgui starts up, it assumes that nothing needs to be drawn behind it. Looking through playgui.cs, I haven't been able to find anything that looks like it would be causing this. If anyone has an idea of where and what I should be looking for I would greatly appreciate it.
Ok, now secondly, this isn't really a problem but I'm looking for some advice on setting up mouse control in playgui. At the moment, when playgui starts up the cursor gets hidden and it becomes your control for being able to look around inside the play area. Once you press F11 the world editor pops up and the control becomes a little different. You get your cursor back and right clicking and dragging becomes your way of looking around.
What I'm trying to accomplish is making it so I'm able to toggle the mouse control in playgui without actually opening the world editor. I'd like to bind a key to be able to toggle the control from having no cursor, to having a cursor and getting the rotation to come from right clicking and dragging. (god I hope I'm making sense)
Anyways, it seems like the world editor is getting its mouse functionality from a preference inside of common\editor\EditorGui.cs. Anyone who has ever actually taken a look inside that particular script might agree with me that things are a bit overwhelming.
Specifically I'm looking for advice on where I should be looking for some idea on how to implement the mouse functionality from the world editor into playgui at the touch of a button. (actually key)
I'm usually pretty embarrassed and reluctant to ask for help but having this functionality is crucial to my project and the rest of the gui work I'll be doing over the next few months. Any help is greatly appreciated. I should really take the time to thank you for even reading this.
-Zach
edit: reversed the picture order
About the author
#2
However, if I had to guess I would imagine that your problem is stemming from you setting the canvas content to the GUI containing the playGui window instead of using a Canvas.pushDialog on the playGui Window.
When you set the canvas content, it removes all content from the canvas and your GUI becomes the only active rendering content on it.
When you push a dialog on the canvas it simply adds that GUI to a new layer on the canvas and things 'under' it still render.
If this isn't what's happening, perhaps showing me your .GUI files and how you're setting them would shed some light.
Hope this helps,
-justin'
07/12/2005 (5:29 pm)
Zach, I can't tell you for sure what's going on since I can't see exactly what you're doing in script.However, if I had to guess I would imagine that your problem is stemming from you setting the canvas content to the GUI containing the playGui window instead of using a Canvas.pushDialog on the playGui Window.
When you set the canvas content, it removes all content from the canvas and your GUI becomes the only active rendering content on it.
When you push a dialog on the canvas it simply adds that GUI to a new layer on the canvas and things 'under' it still render.
If this isn't what's happening, perhaps showing me your .GUI files and how you're setting them would shed some light.
Hope this helps,
-justin'
#3
Thanks a lot for your help.
07/12/2005 (5:58 pm)
Actually Justin you've helped me out a lot. Since I had done most of the work in the built in gui editor I hadn't looked in the scripts to see how play gui was being set. What I had done was modified the playgui.gui to run inside of a guiWindowProfile but I wasn't setting the guiwindowprofile using Canvas.pushDialog.Thanks a lot for your help.
#5
03/16/2007 (6:23 pm)
Justin DuJardin, have you figured out how to use the cursor in playGUI? I can activate the cursor, but it doesn't do anything when I click on my controls I place in my playGUI.
Torque Owner Kirby Webber
It's a thought, but you're on your own there. =\
As for the cursor not showing in payGUI - perhaps this resource could shed some light on the subject.