Game Development Community

GUI layers?

by Shaz · in Torque Game Builder · 08/19/2008 (6:13 pm) · 6 replies

Is there a way to assign a GuiControl or individual elements of a GuiControl (esp GuiTextCtrl) to a specific layer, or don't layers apply here?

I don't want my GUI to display on top of ALL layers of my game, but can't seem to find a way to move it back.

#1
08/19/2008 (8:14 pm)
I have used pushToBack, pullToFront for this before. I believe those are methods on canvas that take the control as a parameter. They also work in the opposite way you might expect, pushToBack puts that control "in front" of others. Also, pushDialog and setContent take a "layer" parameter, i believe, but I have not used it before.

Oh keep in mind that these "layers" are not related at all to the layers in a sceneGraph. So you can't have a guiControl that renders between two different "sceneObject" layers, but you can have it either in front or behind the sceneWindow itself.
#2
08/19/2008 (8:20 pm)
Ah, that explains it all then. Sandwiching my GUI between two scene layers is EXACTLY what I wanted to do. Not possible then, I guess. Pity. Thanks for the info though - at least I won't waste any more time trying to figure it out ;-)
#3
08/19/2008 (8:25 pm)
Well there is one option, use sceneObjects to represent your gui elements. But they will have to also be in the same sceneGraph, and "usually" when people use SOGui's they put the gui objects in a separate overlayed sceneWindow so that camera operations in the game-play-window do not affect the gui objects.
#4
08/19/2008 (8:34 pm)
It is possible. Simply make another scene window and scene graph that sits above your GUI. This tip also gives you more layers to work with, too, as each scene graph has its own 30-ish layers.
#5
08/19/2008 (8:35 pm)
I just realized that my version requires some code changes I have to pass through clicks to the GUIs. I take it all back. *GRIN*
#6
08/19/2008 (9:15 pm)
Thank you both. I think I know what you're getting at. I'll leave it as-is for now, but I'm not really happy with it, so if I have time I'll come back and revisit this. At the very least I'll experiment with it a little, so I approach my next project with it in mind.