I have my GUI interface and as a tutorial I want to draw a box on the GUI (just use a textue) on top of the current GUI in certain places.
How do I handle to ensure the box is always on top?
I have my GUI interface and as a tutorial I want to draw a box on the GUI (just use a textue) on top of the current GUI in certain places.
How do I handle to ensure the box is always on top?
its the Z position of the GUI
i looked that and appears to only work with seperate scripts not in the same script.
write the gui.label/button/… line of code after your GUI system (in the same script). It produces the gui from the first line to the last one so the last guis scripted will be on top of the other. (I’m not sure that i’m really clear… :S)
GUI.Label(new Rect(100, 100, 50, 50), "", background);
if (GUI.Button(new Rect(50, 50, 50, 50), "", Close))
{
print("buttonA");
}
The button will be on top of the label.