- Home /
How to put both text and texture inside a label
I'm trying to do something like that : http://nsa34.casimages.com/img/2013/05/03/130503045447439504.png
But i can't reproduce the same, i've tried with GUIContent or different GUILayout.Label without success... I can't use GUI.Label and place the texture using the rect values because the windows is resized by the device resolution. Here is my actual code :
GUI.skin = guiGuideUtilisation;
GUILayout.BeginArea(new Rect(60, 70, Screen.width - 120, Screen.height - 140));
GUI.Box (new Rect(0, 0, Screen.width - 120, Screen.height - 140),"");
GUI.DrawTexture(new Rect(0,0,100,100),logoGuideUtilisation);
if(GUI.Button (new Rect(Screen.width-166,25,25,25), buttonClose)) {
displayGuide = false;
}
guiGuideUtilisation.label.fontSize = 40;
GUI.Label (new Rect(150,25,400,100),"Guide d'utilisation");
guiGuideUtilisation.label.fontSize = 17;
GUI.Label (new Rect(0,110,Screen.width - 120, Screen.height - 260), stringGuideUtilisation); // actually just displaying a string but this is where I want to use both text and texture
GUILayout.EndArea();
Any idea ?
Thanks
Answer by AVividLight · Mar 15, 2014 at 07:19 PM
Hey Arlem,
Sorry about answering a question that is almost a year old, but I had this same question, and just found the answer. I don't know why GUIContent isn't working for you, but that is the solution that I found. This site helped me a lot, you should take a look at it.
I hope this helps! Michael
Your answer
![](https://koobas.hobune.stream/wayback/20220613101451im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Correctly position GUILayout controls 3 Answers
How do I make my label fit its text? 2 Answers
Unity 5.2 Text Rendering issue 0 Answers
Changing a GUILabel text SIZE 3 Answers
Simple headline / title for a Script in the Inspector 3 Answers