-
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.
-
Re: Multiple colours in a string
Now I got another question, is it possible to make the background of the Rich Edit object transparent? I want to be able to place the text over an semi-transparent image, and I can only select a solid colour background in the options.
-
Re: Multiple colours in a string
Quote:
Originally Posted by bigredron
is it possible to make the background of the Rich Edit object transparent?
Sorry, no. :(
-
Re: Multiple colours in a string
It is possible, but you would have to use a subapp, along with the Kernel or Window Transparency Object to make it partially tranparent. :)
Stephen1980
-
Re: Multiple colours in a string
Stephen that wouldn't work, he wants the background color transparent like with the edit box and multiline.
-
Re: Multiple colours in a string
Quote:
Originally Posted by bigredron
I want to be able to place the text over an semi-transparent image
This is what I meant was possible.
Stephen1980
-
Re: Multiple colours in a string
OK thanks stephen I will take a look. Its not too important, im working on a dialogue engine, like RPG text boxes and it looks better semi-transparent but its not a biggie if it doesnt work
-
Re: Multiple colours in a string
In Gwerdy we thought of a way: Take the RTF text from the REO and put it into a Rich Text object. That ALWAYS has a transparent background. :)
-
Re: Multiple colours in a string
LB - Would that keep the colours carried over from the parsing? Ill give it a shot thanks. Need to download qwerdy again :)
EDIT: Hmm there is a rich text object? Where can I download that?
-
Re: Multiple colours in a string
It comes with MMF2 and TGF2, it's a default object.
-
Re: Multiple colours in a string
I dont have it... Alll I can see is Rich Edit Object. Are you sure its not a dev only extension? I am using MMF standard
-
Re: Multiple colours in a string
Click the "Text" option in the list to the left with the object types. It should be the first object there, "Formatted Text". And it can't be a dev only extension because I used it alot back when all I had was TGF2! :)
-
Re: Multiple colours in a string
oh, i know about that object, it doesnt work. I cant get any text to appear what so ever. I was looking for an object called 'Rich Text Object' cause thats what you called it
-
Re: Multiple colours in a string
What!? It works perfectly fine. Check this example:
http://www.LB-Stuff.com/MMF2/RTF_Text.mfa
You can change the "Every 1 second" condition to whenever you want to update the text. ;)
-
Re: Multiple colours in a string
Load string doesn't work, and I dont want to load from an external file. Thanks anyway.
-
Re: Multiple colours in a string
Well then request that clickteam fixes it.
Load string DOES work, just not if you do it wrong.
-
Re: Multiple colours in a string
Load string = "test" displays nothing for me.
It doesnt work if I load any type of string wether I type it in, load from a string object or RTF object
-
Re: Multiple colours in a string
That's because you have to do a selection before it to tell it where to insert to. Try doing "Select all" before it.
I admit there is no way to clear it without loading a blank file, but if you want a transparent backgroun it's the only way. Also it can be easy to do it wrong. :(
I wish this object were updated.