2D Toolkit Forum

2D Toolkit => Support => Topic started by: quangtu89 on December 18, 2014, 11:04:40 am

Title: Change color a part of tk2dtextmesh ?
Post by: quangtu89 on December 18, 2014, 11:04:40 am
Can change color for a part of text of tk2dtextmesh ? Can anyone help you .
Like this : " this is sample "
Title: Re: Change color a part of tk2dtextmesh ?
Post by: unikronsoftware on December 19, 2014, 10:18:22 pm
On the text mesh, turn on InlineStyling, click "?" for help on the syntax.
Eg. This is ^cf00fsample

Will highlight the word "sample" in red.
Title: Re: Change color a part of tk2dtextmesh ?
Post by: DamDam on May 19, 2015, 08:40:55 pm
Hi and sorry for replying to an old topic (maybe you prefer user start a new topic?) but my problem fits totally with this post.

I want to make a text for a dialog and i want the character name appearing in a different color.

I follow what you re saying in this topic but my text stay in white color.

In my code i put this line :
Code: [Select]
window_text.GetComponent<tk2dTextMesh>().text = " ^cf00fsample ";
But that doesn't work for me.

Note that my font is a personnal font i ve created following your tuto on the site. And my textmesh is set as 'formating';

Have you an idea about what i've miss to make it work ?

(thx in advance and sry for my bad english)
Title: Re: Change color a part of tk2dtextmesh ?
Post by: unikronsoftware on May 19, 2015, 11:36:11 pm
Try entering it in the inspector, and then try it with one of the built in tk2d fonts. This should work (and does work on the latest released version) - must be missing something somewhere.
Title: Re: Change color a part of tk2dtextmesh ?
Post by: DamDam on May 21, 2015, 10:43:53 pm
Thx for your answer. That didn't work because  i've not created my font in 32 bits. Now with a new created font it works :)