Mouse leave tween?

0 favourites
  • 3 posts
From the Asset Store
Calculate parabolic trajectories and tween objects over them.
  • Hello!

    For the interface of my game I want to use the tween behaviour. If the user mouse-overs the interface preview it will tween up. Then he can press buttons inside what came up. When the mouse leaves this area the interface should tween down again.

    How can I detect "on mouse leave"? I tried using a boolean true on mouse-over and setting it to false every tick. But when not mouse-overing that results in the interface permanently tweening down till abyss.

    Any better solutions? Thanks! :D

  • You can use a boolean flag. For example -

    if Button.isActive=false and cursor is over the button 
     -> start Tween "UP"
    On Tween "Up" finished 
     -> Button set isActive to true
    if Button.isActive=true and cursor is NOT over the button 
     -> set isActive to false, start Tween "DOWN"

    You can add "Tween not playing" condition to events 1 and 3 for extra robustness.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Thank you! After some testing after my post I got it to work. I guess it was too late to have good ideas. Now I even used timers and got it to work. :)

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)