- Home /
GUI.Label doesn't show on screen
I am new to Unity and working with GUI. I was able to create GUI Buttons perfectly but when I am drawing GUI Label my code doesn't work and I am not able to view the label on screen. Here is my code snippet -
void OnGUI() {
GUI.Label (new Rect (550, 200, 800, 100),"Choose Level");
}
What am I doing wrong or missing something here?
when you first make gui, its best to draw them in the top left corner first(that's 0,0,100,100) so that you know its working, I don't think you need 800 pixels for just "Choose Level".
try this GUI.Label (new Rect (0, 0, 100, 100),"Choose Level");
other than that I tested and it seems fine. are you drawing anything else that could be writing over that(such as a box).
if your developing on mobiles drawing at 550 might go offscreen.
Answer by PaulBrasfield · May 02, 2013 at 08:55 AM
Is your label to big that it goes off frame? That may be the problem.
Your answer
Follow this Question
Related Questions
Score display not working 1 Answer
Player label appears in sky! 0 Answers
GUI label on raycast? 0 Answers
How to change how meany decimals are in a GUI sound slider 2 Answers
Randomize GUI Position 2 Answers