Page 1 of 1

Advanced coloured text function!

PostPosted: Wed Apr 06, 2011 7:03 pm
by lcl
Hello!

I'm here now with my latest creation, function,
that lets you print text with many colours!



Here is the source code:
colouredText.zip
(29.28 KiB) Downloaded 396 times



There is six escape sequences:

/| - new line
/r - red
/g - green
/b - blue
/y - yellow
/w - white

They are usable like this:
Code: Select all
print("/gThis is just/| /rexample /gline.", 100, 100);

Using code like this, it would print following text to position 100, 100.
This is just
example line.


At create actor event of view, there is function startupDef(7, 12);
It sets the characters to be 7 pixels away from each other in x axis and 12 pixels away from
other lines in y axis.

The .zip contains versions with and without typewriting effect.
I made the one without it for those who don't know so much about scripting for the typewriting codes
not to confuse those people.

It's all based on cloning the text actor and setting the clones
r, g and b values.


If there is something in the code you don't understand, but you want,
don't hesitate to ask me! I would be glad to help people understand this.


Give me feedback about it. :)

-lcl -

colors.png
colors.png (1010 Bytes) Viewed 6116 times

Re: Advanced coloured text function!

PostPosted: Wed Apr 06, 2011 7:27 pm
by schnellboot
Nice man!

Re: Advanced coloured text function!

PostPosted: Wed Apr 06, 2011 7:36 pm
by Camper1995
Wow great! 8)

Re: Advanced coloured text function!

PostPosted: Wed Apr 06, 2011 10:36 pm
by lcl
Thanks guys! :)
I wish that will be useful for someone. :)

Re: Advanced coloured text function!

PostPosted: Mon Apr 25, 2011 8:21 am
by Bee-Ant
Indeed nice !!!
And +1 for your hard work !!! :D

Re: Advanced coloured text function!

PostPosted: Mon Apr 25, 2011 9:42 am
by lcl
Bee-Ant wrote:Indeed nice !!!
And +1 for your hard work !!! :D

Thanks! :)
I realised that I have to make one update to this.
It doesn't currently seem so nice with normal fonts because the
distance between letters is always the same. I have to make it to change the position by the width of the letter. I hope someone understood that.. :lol:

Re: Advanced coloured text function!

PostPosted: Mon Apr 25, 2011 10:16 am
by Bee-Ant
lcl wrote:I wish that will be useful for someone. :)

That would be me !!! :P

lcl wrote:I realised that I have to make one update to this.

You better would !!! :P

Hmmm, it seems that you would be the pyrometal replacement to me.
He offered such great helps back then :)

Re: Advanced coloured text function!

PostPosted: Mon Apr 25, 2011 11:23 am
by lcl
Bee-Ant wrote:
lcl wrote:I wish that will be useful for someone.

That would be me !!! :P

lcl wrote:I realised that I have to make one update to this.

You better would !!! :P

Hmmm, it seems that you would be the pyrometal replacement to me.
He offered such great helps back then :)

I'm glad you may find it useful!
Wow, to be compared to pyrometal is really great honor for me! :)
I will work with that update as soon as possible! :)

Re: Advanced coloured text function!

PostPosted: Tue Apr 26, 2011 4:41 pm
by lcl
That update seems to be quite difficult to make because it seems
like GE doesn't get text actors width and height right.. :P

Re: Advanced coloured text function!

PostPosted: Tue Apr 26, 2011 6:35 pm
by Bee-Ant
It's not the GE, but the font.
I prefer fixed width font anyway :)
It's easier to manage and estimate.

Re: Advanced coloured text function!

PostPosted: Tue Apr 26, 2011 7:03 pm
by lcl
Bee-Ant wrote:It's not the GE, but the font.
I prefer fixed width font anyway :)
It's easier to manage and estimate.

I like those fonts too, they are easier to work with.
But I think Ge really doesn't get the width and height right because I
tried to make the code set the characters (every of them is a clone) positions
according to the previous ones position and width and the current ones width.
It worked with some characters, but not with some other ones. :P

Re: Advanced coloured text function!

PostPosted: Thu Apr 28, 2011 7:55 pm
by Hblade
Amazing!!! :)

Re: Advanced coloured text function!

PostPosted: Thu Apr 28, 2011 7:56 pm
by lcl
Hblade wrote:Amazing!!! :)

Thanks! :)