Author Topic: How to change Bitmap font color with clipping.  (Read 4080 times)

MrMong

  • Guest
How to change Bitmap font color with clipping.
« on: May 23, 2013, 12:28:36 AM »
English is not my native.

I want to some scrollable text.
Unity use completion guarantor font for my native, so i tried to make Bitmap font with BM Font.
problem is, the text (using UILabel) set in UIPanel's clipping range, its color is fixed to white.

i tried to change color like this
label.color = customColor ; (customColor is Color.)

it seems to work well if not use UIPanel with clip. but in the clip range, text color still white.

How can i change text color that inside of clipping range?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: How to change Bitmap font color with clipping.
« Reply #1 on: May 23, 2013, 12:16:27 PM »
You must use the "Unlit/Transparent Colored" shader.

MrMong

  • Guest
Re: How to change Bitmap font color with clipping.
« Reply #2 on: May 23, 2013, 09:31:34 PM »
You must use the "Unlit/Transparent Colored" shader.

i use Unlit/Premultiplied Colored instead. is that shader does not work?

MrMong

  • Guest
Re: How to change Bitmap font color with clipping.
« Reply #3 on: May 23, 2013, 10:12:36 PM »
i use Unlit/Premultiplied Colored instead. is that shader does not work?
tried to change Unlit/Transparent Colored, but still not work.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: How to change Bitmap font color with clipping.
« Reply #4 on: May 24, 2013, 04:41:33 PM »
Premultiplied is fine. Make sure the panel doesn't have depth pass enabled.

MrMong

  • Guest
Re: How to change Bitmap font color with clipping.
« Reply #5 on: May 27, 2013, 03:52:14 AM »
i solved mine. ;o
problem is that i edited premuitiplied colored script some.
and missed some code in shader like col.rgb *= IN.color.rgb;..