Mouse Gestures

For questions about using Classic.

Post » Sun Nov 08, 2009 7:39 am

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?
B
5
G
4
Posts: 50
Reputation: 1,225

Post » Sun Nov 08, 2009 9:22 am

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.
B
55
S
12
G
8
Posts: 339
Reputation: 9,314

Post » Sun Nov 08, 2009 6:58 pm

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!
B
5
G
4
Posts: 50
Reputation: 1,225


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 9 guests