|
This is my inventory menu screen. I've got a method which creates a box where the cursor is, while it's over a weapon image (this semi-transparent box with 'Berdysz 70'). The problem is that each item (so a button, weapon pic, some strings etc) and it's fluff box is generated via a for loop. Therefore every next item is being showed over each previous GUI element. Is there a way to make a GUI elements - in my case this window, always on top?
(comments are locked)
|
|
Yes there is a way, you need to draw it after your for loop. The GUI system is an immediate system, what is drawn at last will show on top. But be careful, the input handling works the other way round: what is drawn first will receive the input. Without the code i can't give you any hints for your case. Another way is to use a GUI.Window. Windows are drawn above the normal gui stuff and have their own z-ordering system.
Aug 16 '11 at 08:20 PM
Bunny83
(comments are locked)
|
|
You can use GUI.depth, it usually works. http://unity3d.com/support/documentation/ScriptReference/GUI-depth.html The thing is GUI.depth works for different classes only, not GUI elements inside one class - which is my case. and Since my showBox method takes parameters from inside of the for loop it's in, it's impossible to throw it out.
Aug 16 '11 at 08:05 PM
4illeen
(comments are locked)
|

