- Home /
Detect if any GUI is being displayed on-screen?
Hey,
I was just wondering if there was anyway to detect if there is any GUI currently being displayed on screen. I have some GUI that shows when you look at an object, and I'm going to be doing the same for many more objects. So rather than have the multiple GUIs be placed on top of each other, I need a way to detect how many of these GUI objects are already on screen, and place the newest one below/to the right of the previous.
Im looking for the same thing, anyone have any solutions? (bump)
Answer by Negagames · May 16, 2013 at 11:16 PM
Ok, so when most people create opening/closing GUIs, there is a bool assimilated with that GUI function. So you could have an array of bools:
var OpenGUIS : boolean[];
and every time a new one opens, it checks to see which ones are already open, and then determines the spot via that method.
Or, you could use GUILayouts. I'm not all too familiar with them but I believe that is might help you or even inspire you:
http://docs.unity3d.com/Documentation/ScriptReference/GUILayout.html
Good Luck!
Your answer
Follow this Question
Related Questions
How do i make a (Working) health bar 1 Answer
GUI Overlay Display 0 Answers
How to display Gui for clips left - FPS tutorial 0 Answers
Why does the font selected for my GUI Skin not display correctly? 1 Answer
Animation not showing when close up 1 Answer