Hey, guys!
I am trying to create a scene on my game where the player must do a diagonal swipe (bottom left to top right, vice-versa). I'm using the Gestures.lua that
@ar2rsawseen created, but I can't make the class recognize only the diagonal swipe...
I'm adding the gesture like this:
self.gest:addGesture("Cut", {
{x = 0, y = 0},
{x = 75, y = 50}
}, self.callback) |
To be honest, I don't understand the class very well, so the points are probably wrong...
Can someone help?
Comments
Check this link
http://giderosmobile.com/forum/discussion/773/scenemanager-and-managing-memory/p1
Here you're going to find @ndoss 's swipe version (his performance)
I hope the above serve you something
Cheers
Likes: AxlFlame
[-] Liasoft
I think I don't see the solution I'm looking for on that topic, unfortunately. What I want is to be able to detect a diagonal swipe on the screen (in-game it's gonna be like a sword slash). I don't know how I would implement this other swipe method you're talking about. Can you explain it to me?
I thought about using @ar2rsawseen 's Gestures.lua, because then I would just need to find out which points would correspond to a diagonal swipe within a given scope.
Unfotunately Gestures.lua won't help you for two reasons.
1) It is meant to detect closest gesture from a set of gestures, so if you only define one gesture, then to any gesture you make, the closest one will be the one you defined
2) I think there was a bug in single line gestures, that their rotation and direction was not properly taken care off
About swipe Gestures, I created something like this some time before:
https://github.com/ar2rsawseen/GiderosCodingEasy/blob/master/GestureEventEasy.lua
But unfortunately it only handles up, down, left, right swipes, but diagonal swipes can be added in similar manner, all you need is to determine direction, or if you don't care which direction it is, as long as it is diagonal swipe, you can even do something as:
Likes: AxlFlame