Gesture Example

Crank Storyboard Designer samples and code snippets.

Moderator: jamiev

Gesture Example

Postby rdowdall » Sun May 23, 2010 2:21 pm

Attached is a Storyboard project that shows how to use gestures. You can run the included gapp file if you just want to take Gestures for a test drive, or you can open the project in the Storyboard Designer. If you are going to run the gapp file with the runtime, make sure you export the GESTURE_DEF_FILE environment variable to point to the custom_gestures.txt.
Attachments
gesture-example.zip
Gesture example storyboard designer project
(196.94 KiB) Downloaded 875 times
rdowdall
 
Posts: 102
Joined: Mon Nov 02, 2009 9:46 pm

Re: Gesture Example

Postby DaveC426913 » Tue Jun 29, 2010 10:22 am

Sorry, I'm still not getting results. (Apologies for cluttering up the forum with my tech support issues).

I wanted to run the Gesture in the simulator on my PC to see what it does. I dropped the unzipped into the samples folder, alongside the other samples. Then I opened StoryBoard Designer, chose New > Storyboard Sample > gestures. It made a new project called gestures.

I then ran the simulation in StoryBoard Designer, which opened a black window that says 'none'. This window is unresponsive to any input and provides no output.
DaveC426913
 
Posts: 27
Joined: Mon Jun 28, 2010 1:23 pm

Re: Gesture Example

Postby DaveC426913 » Wed Jun 30, 2010 8:47 am

This is now working thanks to a temp fix found here:
http://cranksoftware.com/forums/viewtopic.php?f=5&t=55&start=10#p112
DaveC426913
 
Posts: 27
Joined: Mon Jun 28, 2010 1:23 pm

Re: Gesture Example

Postby DaveC426913 » Mon Jul 05, 2010 10:46 am

This sample only simulates gestures, correct? It's basically reading moouse coordinates on mousedown and again on mouseup, right? So it can tell what direction you moved your finger, but it's not like it can respond dynamically in real-time to a gesture.

What I'm trying to figure out is if Crank is able to effectively handle gestures in a way that plain ol' HTML cannot.
DaveC426913
 
Posts: 27
Joined: Mon Jun 28, 2010 1:23 pm

Re: Gesture Example

Postby rdowdall » Mon Jul 05, 2010 12:18 pm

Hello Dave

When the gesture plugin gets a mouse down, or a touch event it starts tracking the motion of the mouse cursor, or finger. It will track until the mouse is released or until you stop touching the screen. It looks at how the direction changes during the motion and builds the gesture based on that. A number has been assigned to each of the directions. So:

North - 1
North East - 2
East - 3
South East - 4
South - 5
South West - 6
West - 7
North West - 8

On a direction change it will tack a number on to the gesture number that gets emitted. So for a "Z" gesture the gesture number would be 363 or
East, South East, East.

When the event is emitted, you get the number and the time it took to do the gesture.

Rodney
rdowdall
 
Posts: 102
Joined: Mon Nov 02, 2009 9:46 pm

Re: Gesture Example

Postby rdowdall » Mon Jul 05, 2010 12:33 pm

Sorry, that direction should read East, South West, East, not East, South East, East.
rdowdall
 
Posts: 102
Joined: Mon Nov 02, 2009 9:46 pm

Re: Gesture Example

Postby nschultz » Mon Feb 13, 2017 9:24 am

The format for custom gestures is out of date in the attached sample. I've uploaded an archive with the corrected gesture file, please use this from now on.
Attachments
gesture-example.zip
Sample with updated gesture format
(196.92 KiB) Downloaded 58 times
nschultz
 
Posts: 21
Joined: Fri Jul 17, 2015 1:51 pm


Return to Samples

Who is online

Users browsing this forum: No registered users and 1 guest

cron