2D Toolkit Forum

2D Toolkit => FAQs => Topic started by: VeTaL on May 12, 2012, 11:09:12 am

Title: Font transparency
Post by: VeTaL on May 12, 2012, 11:09:12 am
Tried
textHero.color.a = 10;

but it is not possible to set value this way.
Title: Re: Font transparency
Post by: unikronsoftware on May 12, 2012, 11:38:24 am
You cant change this on a property directly. You'll need to create a copy, change and set it back. Eg.

Color c = textMesh.color;
c.a = 1.0f;
textMesh.color = c;

Also don't forget, the range is 0..1 not 0..255

Don't forget to call
textMesh.Commit() once you're done.
Title: Re: Font transparency
Post by: VeTaL on May 12, 2012, 11:39:30 am
Thanks for really fast answer :)

I guess, this is nice question to your FAQ collection.