Game Development Community

How to determine the top GUI object

by Frederic · in Torque X 2D · 09/05/2007 (7:08 am) · 3 replies

Is it possible to determine which GUI object is currently being displayed at a certain point on the screen?
I mean without actually looking at it.

I want e.g. to be able to have a click "go through" a GUI object onto the next, and I can't hard code it because the GUI objects need to be movable.

#1
09/05/2007 (9:21 pm)
Unfortunately, we currently don't have any quick and simple way to pick into GUI folders. You could search through them manually, but we're avoiding any platform-specific (read: mouse) functionality in the engine for the time being in favor of stuff that will benefit all/most possible uses of the engine. Sorry for the bad news. :(
#2
09/06/2007 (7:29 am)
Thanks for the quick anweing!

I already implemented my own GUI objects using T2DSceneObjects to allow for greater flexibility (e.g. transparency, flexible sorting oder to be able to draw a custom mouse cursor on top of the GUI object), but the only thing I could not find was how to display text without using GUIText objects.

Is there an easy way to use the XNA functions to draw text and to use the result in Torque X, or would I have to change the engine code (which I do not want to do because the whole stuff should be working with the Torque 3D version)?
#3
09/06/2007 (3:40 pm)
Without source, not really. Well, unless you render the text to a texture and use that texture on a sprite (which might end up being much faster, if your text doesn't change a lot). The reason is that you'd have no way to correctly sort the text in with the rest of the scene objects. You'd have to either draw it all before or all after, and neither of those would get you what I think you're looking for.