Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: MrMong on May 23, 2013, 12:28:36 AM

Title: How to change Bitmap font color with clipping.
Post by: MrMong 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?
Title: Re: How to change Bitmap font color with clipping.
Post by: ArenMook on May 23, 2013, 12:16:27 PM
You must use the "Unlit/Transparent Colored" shader.
Title: Re: How to change Bitmap font color with clipping.
Post by: MrMong 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?
Title: Re: How to change Bitmap font color with clipping.
Post by: MrMong 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.
Title: Re: How to change Bitmap font color with clipping.
Post by: ArenMook on May 24, 2013, 04:41:33 PM
Premultiplied is fine. Make sure the panel doesn't have depth pass enabled.
Title: Re: How to change Bitmap font color with clipping.
Post by: MrMong 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;..