- Home /
How to make specific text in a string array Bold C#
Hi everyone, I was wondering how do make a specific text in a string array bold?
public string[] Text;
Text = new string []{"Exampletext", "Exampletext2","Exampletext3"}//Make Exampletext3 bold code
WHERE? in $$anonymous$$onoDevelop? in the editor? in-game?
Answer by keenanwoodall · Dec 09, 2015 at 12:58 PM
@DangerousBeans You can use html tags.
Here is the link to the Rich Text Documentation: http://docs.unity3d.com/$$anonymous$$anual/StyledText.html
Answer by Owen-Reynolds · Nov 14, 2012 at 03:17 PM
There's no bold shortcut, like adding angle-brackets B or something. You have to make up your own rule for bolding and draw it bold yourself. In general, mixing fonts, colors... is a pain (possibly something in the Asset store can do it.)
You might have another array `TextS = { "", "italics", "bold"};`. Then you'd manually check and either use your premade bold GUIStyle, or spawn your alternate GUIText with a bold font loaded.