Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: briangibson on April 24, 2014, 01:13:50 AM

Title: 3.5.7 UIButton possible bug? : 'normal color' is set by a UIWidget's alpha.
Post by: briangibson on April 24, 2014, 01:13:50 AM
UIButton's 'Normal Color' is coupled to the UIWidget's 'alpha' property.
This means that if I do a TweenAlpha on a UIWidget that has a button on it, it uses whatever the color that was set before I hit play.
This is counterintuitive and seems an awful lot like a bug- but perhaps the suggested workaround is to not have a UIWidget and a UIButton on the same gameobject?

I.e.: there are two possible scenarios, and each behaves differently:
1) I set the Alpha property of the widget to 0, and hit play.
Run a TweenAlpha from code to trigger to a value of 1.
Hover over the button, and then hover away - the button will fade away to invisible.

2) I set the Alpha property of the widget to 1, and hit play.
Run a TweenAlpha from code to trigger a tween from 0 to a value of 1.
Hover over the button, hover away, nothing happens. this is to be expected.
Title: Re: 3.5.7 UIButton possible bug? : 'normal color' is set by a UIWidget's alpha.
Post by: ArenMook on April 24, 2014, 01:32:29 AM
Alpha is cumulative. If you want to tween alpha of something that also has its color tweened, then decouple them into a parent-child like so:

Widget (TweenAlpha)
- Sprite (TweenColor)