Author Topic: UIButton > NORMAL state with ALPHA 0 break the button (v. 3.0.9f3)  (Read 2793 times)

mrKaizen

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 10
    • View Profile
    • TheShortAndTheTall
Hi!
Since the last update 3.0.9f3 my Buttons that have, in NORMAL state, alpha = 0 didn't work anymore: no event is released, no color change, nothing. (so be clear: the buttons are invisible and if you go over with the mouse they should appear).
I tried to change the NORMAL STATE ALPHA to 1 (so near to invisible) and it works... maybe some count error?

Tks in advance for your support. ^_^

--
ALberto Doriguzzi Bozzo > mrKaizen

COLOSSUS ESCAPE, fantasy action runner with supermoves -- EFFING DEAD, survival action in RE4 style
@mr_kaizen

BehindTheStone

  • Full Member
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 135
    • View Profile
Re: UIButton > NORMAL state with ALPHA 0 break the button (v. 3.0.9f3)
« Reply #1 on: January 21, 2014, 09:36:38 AM »
Have a look at your collider! If I'm not mistaken, since the last updates the alpha value influences the collider!
If the Alpha value is 0 the Collider automatically disables.

mrKaizen

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 10
    • View Profile
    • TheShortAndTheTall
Re: UIButton > NORMAL state with ALPHA 0 break the button (v. 3.0.9f3)
« Reply #2 on: January 21, 2014, 10:01:12 AM »
Have a look at your collider! If I'm not mistaken, since the last updates the alpha value influences the collider!
If the Alpha value is 0 the Collider automatically disables.

Oh, I missed this... really? And if I want a button that has the NORMAL state with alpha = 0 what should I do? Are you sure about this?
Btw my collider IS NOT disabled..  :\

A pic (the button is NOT the label):
--
ALberto Doriguzzi Bozzo > mrKaizen

COLOSSUS ESCAPE, fantasy action runner with supermoves -- EFFING DEAD, survival action in RE4 style
@mr_kaizen

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UIButton > NORMAL state with ALPHA 0 break the button (v. 3.0.9f3)
« Reply #3 on: January 21, 2014, 06:07:04 PM »
If you have a widget and a collider on the same object, then the widget's alpha automatically makes the collider invalid for raycasts if its alpha is 0.

There are other ways to create an invisible area -- by using a UIWidget instead of a UISprite, for example.

UIWidget (Button targeting a child sprite, collider)
- UISprite (background, anchored to the widget)
- UILabel

mrKaizen

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 10
    • View Profile
    • TheShortAndTheTall
Re: UIButton > NORMAL state with ALPHA 0 break the button (v. 3.0.9f3)
« Reply #4 on: January 21, 2014, 07:11:08 PM »
If you have a widget and a collider on the same object, then the widget's alpha automatically makes the collider invalid for raycasts if its alpha is 0.

There are other ways to create an invisible area -- by using a UIWidget instead of a UISprite, for example.

UIWidget (Button targeting a child sprite, collider)
- UISprite (background, anchored to the widget)
- UILabel

Ooooh, perfect! Tks for the info. ^_^
I honestly don't like that approach but if there is anther (right) way to do it it's ok. ;)
--
ALberto Doriguzzi Bozzo > mrKaizen

COLOSSUS ESCAPE, fantasy action runner with supermoves -- EFFING DEAD, survival action in RE4 style
@mr_kaizen