Touch Gestures

Monkey Forums/Monkey Programming/Touch Gestures

Indiepath(Posted 2011) [#1]
Perhaps not necessary in the gaming world but useful in other kinds of apps. I can see myself needing this in the coming months, certainly on iOS and Android.

The gestures I'm particularly intested in are "two finger scroll" & "pinch/scale/rotate"

So.. how should one approach this? write a new module or mod the existing modules?

I already know how to do this in Javascript, could do with some help with native iOS etc....


Perturbatio(Posted 2011) [#2]
Well, TouchDown(index=0) determines touch events for each finger, so if touchdown(0) and touchdown(1) and not touchdown(2) then check distance between each and direction of movement.

some ugly iPhone code:
http://www.edumobile.org/iphone/iphone-programming-tutorials/how-to-detect-pinch-in-iphone/

for android, this looks like the thing:
http://developer.android.com/reference/android/view/GestureDetector.html