Author Topic: Sprite color linked to UIButton color, why?  (Read 6964 times)

2cat

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 10
    • View Profile
Sprite color linked to UIButton color, why?
« 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.
« Last Edit: February 17, 2014, 06:09:03 AM by 2cat »

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Sprite color linked to UIButton color, why?
« Reply #1 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

2cat

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 10
    • View Profile
Re: Sprite color linked to UIButton color, why?
« Reply #2 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.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Sprite color linked to UIButton color, why?
« Reply #3 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.