Quantcast
Channel: Answers by "Graham-Dunnett"
Viewing all articles
Browse latest Browse all 959

Answer by Graham Dunnett

$
0
0
Make sure the GUIText has rich text enabled: http://docs.unity3d.com/Documentation/ScriptReference/GUIText-richText.html Then you can use html-style markup as documented here: http://docs.unity3d.com/Documentation/Manual/StyledText.html Now your problem boils down into working out how to generate the marked up string. I think I'd handle this by keeping a count of the number of characters that have been entered correctly, then split the string at that point. Stuff to the left of the cut point have been typed, so mark them up in red, and stuff to the right has yet to be typed, so mark them up in white. So, is the string is `HelloWorld` and you've typed up to the `W` then you've typed 6 characters, so you have `HelloW` and `orld`, so you can create <color=red>HelloW</color> <color=white>orld</color>.

Viewing all articles
Browse latest Browse all 959

Trending Articles