Is it possible to change the color of individual letters in a text file? in html, I could use the <span> tag.
I've come up with some solutions in my head, but they're really really dirty. Here's a couple:
Any help would be appreciated! I've tried the latter example and it worked but surely there's an easier, more elegant way?
I'd suggest snooping around the plugin section, I'm 80% sure I saw a plugin that will allow you to change the colors of individual letters.
Develop games in your browser. Powerful, performant & highly capable.
I had a brief look but couldn't find anything. Will check again
have a look at this topic - might help, might not...
edit - 20:35 3/10/2015
Yeah, no inline CSS that i am aware of for text in C2.
I usually use different text objects for the color change. Spawn the first part of the sentence, and get the text width, then spawn your color changed word at The text object.X axis+text.width. Add the New text width to the first text width, so we can add the last part of the sentence with the color returned to the original.
How do I highlight string text?
If you're interested in my result, check this out:
It's a prototype for a touch typing program the gradually add's new words each time you reach the end of the line. The method I ended up using is relatively clean... It involves masks and spawning sprites. To make it move across the page, I had to be sure of the distance between two words so I used sprite text and made the letters equal distance apart.
The hard part was finding a font I liked and converting it into an evenly spaced sprite font, but I got there in the end!