Hello Guest

Author Topic: Font transparency  (Read 25668 times)

VeTaL

  • Newbie
  • *
  • Posts: 18
    • View Profile
Font transparency
« on: May 12, 2012, 11:09:12 am »
Tried
textHero.color.a = 10;

but it is not possible to set value this way.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Font transparency
« Reply #1 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.

VeTaL

  • Newbie
  • *
  • Posts: 18
    • View Profile
Re: Font transparency
« Reply #2 on: May 12, 2012, 11:39:30 am »
Thanks for really fast answer :)

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