Author Topic: Trigger tween with Hover OR select  (Read 3652 times)

AeornFlippout

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 46
    • View Profile
Trigger tween with Hover OR select
« on: January 24, 2014, 03:34:46 PM »
I have a tween on a button that I'd like to trigger when the mouse hovers over the button, or when it's selected via UIButtonKeys.
I'd then like to trigger the reverse tween when the button becomes de-selected/de-hovered.

Is there an easy way to accomplish this?

AeornFlippout

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 46
    • View Profile
Re: Trigger tween with Hover OR select
« Reply #1 on: January 24, 2014, 10:28:09 PM »
Looking into this a bit more - it seems that back in the version I was using (2.3.1) the selectedObject setter was calling the highlight function, which called OnHover on the selected button. This no longer happens. Was that an oversight?

What i want is pretty simple: A highlight sprite that has a looping tween that's activated when the mouse hovers over that button, or when it's selected with a controller. When the mouse leaves the button or the selection changes to another button, I want the highlight to go away.

At the moment it seems like I need to use 4 tween components on a button to accomplish this properly.