Author Topic: Child label alpha is not affected by parent alpha, except when zero.  (Read 2213 times)

Skjalg

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 6
    • View Profile
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.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Child label alpha is not affected by parent alpha, except when zero.
« Reply #1 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.

Skjalg

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 6
    • View Profile
Re: Child label alpha is not affected by parent alpha, except when zero.
« Reply #2 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?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Child label alpha is not affected by parent alpha, except when zero.
« Reply #3 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.

afrokick

  • Newbie
  • *
  • Thank You
  • -Given: 4
  • -Receive: 0
  • Posts: 6
    • View Profile
Re: Child label alpha is not affected by parent alpha, except when zero.
« Reply #4 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)

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Child label alpha is not affected by parent alpha, except when zero.
« Reply #5 on: October 18, 2015, 06:32:09 PM »
Widget (alpha 1), put UIButton and collider on it
- Background (0.5)
- Label (1)