Multiple colours in a string
Is it possible to display certain words in a string a different colour than the rest? I am hopign that its possible with the string parser and rich edit object, but I cant get it working...
For example, this string "today I ate an ^3apple" would display the word apple in green text.
The idea is that the ^ symbol followed by a number would be a delimeter which would signal a change in colour. In this example ^3 is green text
Does anyone have an example they can make, I cant seem to make any sense of it :(
Re: Multiple colours in a string
I'll make an example later if you don't understand, but what you would have to do is search for ^, then look for the number, then find the space after the word. Then you can select the word and highlight it.
Re: Multiple colours in a string
I dont think that is possible with the String Object. You could use the Rich Edit Box or multiple String Objects.
Stephen1980
Re: Multiple colours in a string
The formatted text object should be optimal, although I have never used it myself.
Re: Multiple colours in a string
I just did a quick test from Looki's suggestion, and the Formatted Text Object works easily for what you need. :)
Stephen1980
Re: Multiple colours in a string
Quote:
Originally Posted by Stephen1980
I dont think that is possible with the String Object.
Quote:
Originally Posted by bigredron
I am hopign that its possible with the string parser and rich edit object, but I cant get it working...
Re: Multiple colours in a string
The Formatted text object will do this easily but is not supported by the Flash exporter.
STeve
Re: Multiple colours in a string
This isn;t for flash. Can someone make an example please? I was playing with it yesterday and couldn't even get the Formatted Text Object to display anything...
Re: Multiple colours in a string
I got it! :D And it's easy to add your own colors to it, too! Just add a new Alterable Value to it named nything, and change event 6 where it says "<= 2" to "<= #" where # is the number of colors you have. I'll have to edit it some if you want to have more than ten (0-9) colors, though.
http://www.LB-Stuff.com/MMF2/Colorizer.png
Get it here at the File Archive. :D
Re: Multiple colours in a string
Thanks I will check it out. Im doing some stuff with LUA with this, so hopefully it should get me on my way thanks.