Mouse Gestures

This forum is currently in read-only mode.
From the Asset Store
Easy Gestures
$10.99 USD
Easily add touch gesture recognition to your mobile game
  • Howdy. Been a while since I've been here, but I have a question. And I've been stuck on it for a while.

    I need mouse gestures. I want to be able to have the player hold down the mouse button and drag the cursor in a circle for 2 or 3 seconds, which would then initiate a new event.

    Is there a way to do this?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I'd have a few sprites (probably 4) that follow the mouse when it isn't down in a circley formation. Then, when it is, they act as "waypoints" - when the mouse passes over them, a Private Variable becomes true or something. If all four waypoints become "true" within one "mouse down" event, then the user has drawn a circle.

    With this, you probably want some kind of outline/ghost for the user to trace over, so they know what kind of circle they need to draw.

  • Just checking in to say I tried your method and it worked great! I've set up a small circle of waypoints that follow the mouse cursor until the mouse is clicked. When it is clicked the waypoints no longer follow the mouse and are set into position (until the mouse button is let go). Each waypoint is turned on when the mouse cursor touches it. In the center of this waypoint circle is an additional sprite that when touched resets all of the waypoints to off (to ensure that the cursor is in fact being dragged in a circle). There is also a large circle surrounding all of the waypoints so if the cursor goes outside the circle shape, it resets the waypoints to off.

    That way the player has to draw a circle!

    It works great! Thanks a lot man! Now when the player draws a circle I can make things appear right in the middle! Exactly what I wanted! Thanks!

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