Question by
BrkTbn · Jul 26, 2016 at 10:31 PM ·
colorlabelguistylepropertyfield
PropertyField Label Color
Hi,
How do I change the text color of the label that appears in front of a property field to white? It does not have any GUIStyle parameters and I do not know which GUI.skin element I should modify.
Thanks.
Comment
Best Answer
Answer by andrei2699 · Jul 28, 2016 at 01:04 PM
Try this:
string text = "<color=white>" + "What you want to write" + "</color>";
GUI.Label (new Rect (10, 10, 100, 20), text);
More information is here.
PropertyField takes the label as a GUIContent parameter, and I have just tried this on GUIContent.text field, with no luck.
Update: I managed to make it work by setting EditorStyles.label.richText to true.
Now I can use tag works with PropertyField.
Can you share a code snippet, I tried setting the EditorStyles.label.richText to true but there's no change to the label text.
screenshot.png
(5.2 kB)
SUPER late on my part, but for anyone else, he means it like this
screenshot-2021-11-14-174707.png
(14.0 kB)