D3m0nE
1
Hello Guyz
i have 1 Label
GUILayout.Label(PlayerName + "Is" + "Dead");
i want It Multicolor (PlayerName > Red. “Is” > Green. “Dead” > Blue)
Without useing This Code :
GUI.color = Color.red;
GUILayout.Label(PlayerName)
GUI.color = Color.Green;
GUILayout.Label("Is")
GUI.color = Color.Blue;
GUILayout.Label("Dead")
Because i Need It In 1 Line Only
If you use Unity4, just use HTML tags:
http://forum.unity3d.com/threads/152443-Unity-4-styled-text-any-docs
Keep in mind that you have to use a style that has the richText property ticked.
edit
If you use Unity3x or earlier you have to use something like that:
GUILayout.BeginHorizontal();
GUI.color = Color.red;
GUILayout.Label(PlayerName)
GUI.color = Color.Green;
GUILayout.Label("Is")
GUI.color = Color.Blue;
GUILayout.Label("Dead")
GUILayout.EndHorizontal();
In some cases that’s even more flexible since you can define a specific size for each part
umar43
3
you can use html colour codes to set multiple colours of a label.
Example:
“[FF0000]Red[0000FF]Blue”