Let me add a little to this.
When you get your “moved” phase, there is an event.xStart and event.yStart value in addition to event.x and event.y.
If you only care about horizontal swipes then you simply need to decide how much movement is a swipe and do something like:
local isSwipe = math.abs(event.x - event.xStart) \> 10 if isSwipe then -- do something end
if you care about vertical swipes, then use the .y and.yStart values. If direction is important, then you need a bit more math.
local xDistance = math.abs(event.x - event.xStart) local yDistance = math.abs(event.y - event.yStart) local distanceMoved = math.sqrt( xDistance \* xDistance + yDistance \* yDistance)
And with that info you can also get the angle of the swipe with a little trigonometry.
Rob