Author Topic: Button tweening to transparent  (Read 3874 times)

Litteratus

  • Guest
Button tweening to transparent
« on: April 10, 2013, 08:31:51 PM »
I have a set of buttons that I have set isEnabled to false on startup, and once a network connection has been established, I set isEnabled to true. I also have a UIButtonPlayAnimation disabled initially, so while they are greyed out, they do not do the scale animation like the rest. The problem that I am having is, since the button is initially selected, when the button becomes enabled, it tweens from solid black to a completely alpha image. If I were to move the cursor off of the button, and move it back it snaps the button back in to fully opaque.

My question is, is there a better way of disabling a button initially, and enabling it on some event? If not, has anybody else had this issue?

I have uploaded a video showing the problem.

http://www.youtube.com/watch?v=P6dbmBBcRrs

Litteratus

  • Guest
Re: Button tweening to transparent
« Reply #1 on: April 13, 2013, 08:08:52 PM »
I still haven't figured out what's going on here.. however it seems to happen when I enable the animation on a disabled button. If I enable(start rendering) the button after the animation has been re-enabled, it starts out fully black, and tweens to transparent. Of course when the animation is re-played, everything pops back in like normal.

cbartlett

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 1
  • Posts: 43
    • View Profile
Re: Button tweening to transparent
« Reply #2 on: April 15, 2013, 10:11:26 AM »
Yes, in the initialization of the code, the alpha is set to the tween values at the incorrect location or time and you get bad values.  I have found it is often dependent on what state I start the widgets out in.  IE if they are enabled in the editor prior to playing they have a different behavior than if they are disabled prior to playing. 

To help this out I will set them to a specific state and then use code to automatically set them.  Warning: script execution order can muck with this!!!