Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: mrKaizen on January 21, 2014, 09:30:26 AM

Title: UIButton > NORMAL state with ALPHA 0 break the button (v. 3.0.9f3)
Post by: mrKaizen on January 21, 2014, 09:30:26 AM
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. ^_^

Title: Re: UIButton > NORMAL state with ALPHA 0 break the button (v. 3.0.9f3)
Post by: BehindTheStone 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.
Title: Re: UIButton > NORMAL state with ALPHA 0 break the button (v. 3.0.9f3)
Post by: mrKaizen 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):
(http://colossusescape.com/images/stories/imagesdwl/buttonalpha0.jpg)
Title: Re: UIButton > NORMAL state with ALPHA 0 break the button (v. 3.0.9f3)
Post by: ArenMook 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
Title: Re: UIButton > NORMAL state with ALPHA 0 break the button (v. 3.0.9f3)
Post by: mrKaizen 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. ;)