Author Topic: How to keep Tween Color looping when mouse moves over it  (Read 3533 times)

technoir

  • Newbie
  • *
  • Thank You
  • -Given: 3
  • -Receive: 1
  • Posts: 27
    • View Profile
How to keep Tween Color looping when mouse moves over it
« on: August 06, 2014, 07:22:00 PM »
Hi,

I was wondering how this could be achieved. It seems that when the mouse is hovered over a button with looping Color Tween, it changes to the hover colour (as expected) and when dragged off, leaves the button in its 'To' colour state of the Tween. Looking at the Inspector, the Tween is now disabled with its 'From' colour state now the Hover colour.

Any help with this would be great.
Thanks in advance.


ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: How to keep Tween Color looping when mouse moves over it
« Reply #1 on: August 07, 2014, 03:19:34 AM »
A looping color tween? Looped tweens have no end, so I'm not sure how this would work here. Hover over, hover out -- it's a finite operation. If you're trying to do something like hover over -- play some color animation -- hover out -- stop the animation, I would suggest setting it up like so:

UIButton
- Background Sprite
- UIWidget (so you can fade this in by adjusting alpha)
-- Foreground Sprite (that you will actually have the color tween on, playing endlessly)

So hovering over a button will fade in the widget. Foreground Sprite will have an active color tween on it the entire time, and you won't be touching it.