_gesture.lua coming soon

Create custom gestures for your app. Simple define the gesture, set a few options, then fine tune for the best results. In the video I’ve defined four gestures, ‘CircleLeft’, ‘CircleRight’, ‘A’, & ‘Greater Than’. I’ve set ‘Greater Than’ to require an exact match of the strokes with no mistakes. ‘A’ is set with only in the correct order but can have one mistake. ‘CircleLeft’ & ‘CircleRight’ are set with up to 2 mistakes and can start at any point in the circle.

[media]http://youtu.be/iptMD49AR38[/media]

and heres the code required to make these gestures work.

local gesture = require('gesture')                                -- require gesture lib function onGestureRead(e)                                         -- function called when a good gesture is read   print("gesture match order: "..e.gestureOrder..", name: "..e.gestureName.. ", rotation: "..e.gestureAngle) end gesture.defineGestures( { {"46", "GreaterThan",        0, 0},     -- requires exact match of greater than symbol                           {"248", "A",                 0, 1},     -- requires no more then one mistake for match                           {"87654321", "CircleLeft",  45, 2},     --                           {"12345678", "CircleRight", 45, 2}})    -- rotates the order around so you can start gesture                                                                   -- in any direction but requires no more then 2 mistakes gesture.start()                                                   -- start reading gestures Runtime:addEventListener( "gesture", onGestureRead )              -- if a good gesture is read go to function

This sounds amazing. I look forward to trying it once released. 

thx.

This looks very cool! When will it be available?

maybe this weekend i’ve put it to the side for a few days to work on my new class thats allows you to use the keyboard to control screen taps in the sim.

Er… I don’t get how you’re setting up the gestures. How are you defining what the gesture should be?

I mean with that first string.

  • C

Each number is a movement direction. Ex. 4 is down and right and 6 is down and left

Ah… I see.

Looks cool!

  • C

Thx
It’s surprised me how well it works

This just looks really cool. I’m really looking forward to getting my hands on this!

Thx

I have the privilege of being a tester for this amazing library. jstrahan has done a great job with the concept and implementation. It is very quick to get it going in your project and develop your gestures. It is a lot of fun working with it too! Can’t wait for its final release. Way to go!!!

Thx kana
Glad you’ve enjoyed testing it.
Got a couple more changes ima make tonite that should make it a little more accurate

Wow. talk about good timing. I’m brand new to Corona / Lua (well, to game programming in general) and was just wondering how to implement custom gestures for an idea I have for a game. (Later…first I need to get up to speed in Corona.) And now I see you have a library you are going to release for exactly that. This looks awesome! You should have a mailing list or something so interested people can know when they can get it. :slight_smile:

Cool!

Is there a way to make it adjust sensitivity (without only using the mistake count)?

  • C

Can you do gestures that you lift your finger off during the gesture? I see you have an “A” gesture as an example. Normally you would lift your finger off the screen to do the cross bar part (or whatever it’s called). 

What about multi-finger gestures too?

@ingemar
Thx
@robert1966
Thx
As far as lifting finger and multitouch that’s some of the features I have plan for 2.0 wanted to get single touch working as good as I can first. It’s still not perfect but I think it’s pretty good so far
@calep
I use a few different things for sensitivity. The two adjustable one are first the distance your finger moves before it reads the location and second is the line width. The wider the line the more accurate the read. Then on top of that if there’s no change in direction it doesn’t read and if there’s a quick change in direction the back ( a wobble) it throws it out

Cool. Well I won’t need finger lifting and multi-finger for months yet. (At least.) I am going to try to make 1 or 2 simple games to get my feet wet before I even think about tackling the bigger game I want to make (and that’s the one that will need those features).

It’s kind of annoying when you have a really cool idea and you wanna tell everyone about it but you have to keep your mouth shut! I wish I already knew what I was doing so I could make the game I really wanna make already. haha. 

Thanks a lot for your work on this.

@calep
Wanna give it a test run?