Question by
Douvantzis · Apr 16, 2016 at 04:28 PM ·
richtextbox
Rich text in LabelField
I used the following code to have richtext:
GUIStyle style = new GUIStyle();
style.richText = true;
EditorGUILayout.LabelField("Some <color=yellow>RICH</color> text", style);
However, the font and the padding is is different than the default style used in the editor. What other properties should I set to the style to match the editor's default?
Comment
Best Answer
Answer by Douvantzis · Apr 16, 2016 at 04:51 PM
Turns out I had to initialize the style correctly:
GUIStyle style = new GUIStyle(GUI.skin.label);
Your answer
Follow this Question
Related Questions
UI Text rich formatting broken after upgrading to 5.2 1 Answer
Highlighing words in sentence one by one 0 Answers
(C#) How can I make a rich text autotyper for an rpg dialogue box? 1 Answer
How to have rich text in an input field? 0 Answers
How to properly update caret position when modifying TMP input field with Rich Text ? 0 Answers