Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: Skjalg on October 10, 2014, 04:07:04 AM

Title: Child label alpha is not affected by parent alpha, except when zero.
Post by: Skjalg on October 10, 2014, 04:07:04 AM
If I have one label under another label and change the parent labels alpha to 0.5 the child label is still rendered at full alpha.

But If I have one label under a uisprite and change the parent sprites alpha to 0.5 the child label is rendered at 0.5 alpha (as it should be, i think).

Why would I nest two labels, you ask? Because I want outline (on the parent) and shadow (the child) on my text.
Title: Re: Child label alpha is not affected by parent alpha, except when zero.
Post by: ArenMook on October 11, 2014, 04:02:32 AM
Alpha is always inherited. I can see there being an issue if you reparent something and never notify it that the parent has changed, but that's it.
Title: Re: Child label alpha is not affected by parent alpha, except when zero.
Post by: Skjalg on October 13, 2014, 04:01:01 AM
If alpha is always inherited, then this is a bug.

as I said;
Quote
If I have one label under another label and change the parent labels alpha to 0.5 the child label is still rendered at full alpha.

The correct behaviour would be that if I have one label under another label and change the parent labels alpha to 0.5 the child label should also be 0.5. Correct?
But as I said, its still rendered at full alpha.

Which is why it is a bug, right?
Title: Re: Child label alpha is not affected by parent alpha, except when zero.
Post by: ArenMook on October 14, 2014, 01:11:13 PM
Yes, that how it should be. Alpha is cumulative. It works exactly like that on my end, so I'll need to know steps to follow to reproduce it with the latest version.
Title: Re: Child label alpha is not affected by parent alpha, except when zero.
Post by: afrokick on October 14, 2015, 01:41:46 PM
Yes, that how it should be. Alpha is cumulative. It works exactly like that on my end, so I'll need to know steps to follow to reproduce it with the latest version.

How can I avoid this flow? I want to have btn's bg with 0.5 alpha and label(child) with 1alpha

-btn(0.5alpha)
--label(1alpha)
Title: Re: Child label alpha is not affected by parent alpha, except when zero.
Post by: ArenMook on October 18, 2015, 06:32:09 PM
Widget (alpha 1), put UIButton and collider on it
- Background (0.5)
- Label (1)