Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: 2cat on February 17, 2014, 05:53:19 AM

Title: Sprite color linked to UIButton color, why?
Post by: 2cat on February 17, 2014, 05:53:19 AM
Is there a reason why the color of a widget is linked to the color of UIButton normal state color? Right now it's really annoying to fade in a button using TweenAlpha since you have to set the alpha of the widget to 0 if you don't want it to flicker. However, since it's linked to the Normal state of the UIButton script when you mouse over the button it will go back to that normal state, 0 alpha.

Is there a way to unlink it or give users the option of linking it or not? Since you're trying to make things easier to manage in the editor and by not using scripting something like that would be really useful.

Also, since the UIButton thing dynamically adds a TweenColor to the widget it gets even more annoying in having to change everything to get it to properly do what you want.
Title: Re: Sprite color linked to UIButton color, why?
Post by: ArenMook on February 17, 2014, 11:58:41 AM
Consistency. The button is in its "normal" state by default.

Why are you fading in a button itself? Why not fade in a panel that contains the button, or the button's parent widget?

Panel (fade this in)
- Button1
- Button2
- Button3

or:

Widget (fade this in)
- Button
Title: Re: Sprite color linked to UIButton color, why?
Post by: 2cat on February 17, 2014, 12:52:44 PM
Because I need to fade each button separately, and with a slight delay.

Now I have to set both the uisprite .color and the uibutton .defaultColor to the proper state. I don't mind the consistency but when I'm doing more than just simple things it's really annoying.
Title: Re: Sprite color linked to UIButton color, why?
Post by: ArenMook on February 17, 2014, 01:49:54 PM
Well the problem lies in the fact that you have color modifications coming from two places. The tween modifies it, and so does the button.

This is why you need to separate the two. Tween the parent widget then.