- Home /
texture and text on gui
Hi any idea why this dosent display the text aswell? it only displays texture
GUI.Label(new Rect(10, 10, 100, 20), HungerIcon ,"Hunger : " + Hunger.ToString());
Comment
Best Answer
Answer by fafase · Dec 21, 2014 at 05:29 PM
there is no overload I can see, taking rect, texture, text.
http://docs.unity3d.com/ScriptReference/GUI.Label.html
You need to use the GUIContent and fill the image and text and pass it(third overload).
GUI.Label(new Rect(40, 400, 100, 30), "Hunger : " + Hunger.ToString());
GUI.Label(new Rect(40, 430, 100, 30), "Thirst : " + Thirst.ToString());
GUI.Label(new Rect(10, 400, 100, 30), HungerIcon);
GUI.Label(new Rect(10, 430, 100, 30), ThirstIcon);
Your answer
![](https://koobas.hobune.stream/wayback/20220613174554im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
GUI.HorizontalSlider not working 2 Answers
GUI.Window Problem Option Menu 1 Answer
Show GUI.Label when touching trigger 4 Answers
How to disable my Script and Gui 1 Answer