- Home /
Answer by ZeroKitsunei · Oct 14, 2012 at 05:34 AM
http://docs.unity3d.com/Documentation/ScriptReference/GUI.Label.html
http://docs.unity3d.com/Documentation/Components/gui-Customization.html
Check out the above links for information on GUI and GUI.Label customization. An Example:
using UnityEngine;
using System.Collections;
public class CustomLabel : MonoBehaviour {
public GUIStyle myGUIStyle;
void OnGUI () {
GUI.Label(Rect(10,10,200,30), "My Custom Label!", myGUIStyle);
}
}
Answer by Beru · Dec 27, 2013 at 03:08 AM
If you just want to change the color, this will make it:
void OnGUI() { GUI.contentColor = Color.yellow; GUI.Button(new Rect(10, 10, 70, 30), "A button"); }
Answer by Beru · Dec 27, 2013 at 03:08 AM
If you just want to change the color, this will make it:
void OnGUI() {
GUI.contentColor = Color.yellow;
GUI.Button(new Rect(10, 10, 70, 30), "A button");
}
This does not seem to have any effect with Unity 5.0.1f. Testing it inside EditorWindow.
Answer by Dank_Mushies · Apr 23, 2016 at 10:45 AM
Try this:
myGUIStyle.font.fontSize = myTextSize;
myGUIStyle.font.material.color = myColor;
Your answer
![](https://koobas.hobune.stream/wayback/20220613082311im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
I keep getting an error on my for loop. 1 Answer
Labels aren't colored properly 1 Answer
GUI Label "flash a Arrow" 1 Answer
MultiColor In 1 Label? 2 Answers
Drawing 4 GUIButton's with a forloop. Need help changing color? 1 Answer