Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: mathiassoeholm on April 30, 2014, 08:03:02 AM

Title: Nested alpha, feature or bug?
Post by: mathiassoeholm on April 30, 2014, 08:03:02 AM
Hi there!

I recently encountered some funky behaviour when nesting widgets.

(http://i.imgur.com/NCCFPIz.png)

So in the above image.
"b" is a child of "a".
"b" should be 100% opaque since the alpha component of it's color is 255.
But as a result of being a child of "a", it inherits the alpha.
The same is true for the label "d", which is also a child of "a".

This behaviour was a bit unexpected, but maybe it's intentional?

Thanks! :-)
Title: Re: Nested alpha, feature or bug?
Post by: ArenMook on April 30, 2014, 05:34:46 PM
Alpha is nested. This is intentional. And it's not just for widgets -- panels too. It's so in order to fade out a widget, you only need to adjust one value, not tween alpha on every single one of its children.
Title: Re: Nested alpha, feature or bug?
Post by: mathiassoeholm on May 01, 2014, 02:21:50 AM
Got it.. Thanks! :-)