get swipe direction

im new in Corona SDK and i would like some help: i want to chek the direction of the user swipe, I have an object:

local Rect = display.newRect(30,30,30,30) Rect:setFillColor(255,0,0)

and i want to add to him a Listener

Runtime:addEventListener("touch",SwipeTouchEvent)

in the function i want to chek if there was a swipe, and for what direction the swipe was. if is was up add 1 to int up; if it was down, add 1 to int down; if it was right add 1 to int right and if it was left, add 1 to int left; and display all the ints on the screen… thanks for helpers!

Here’s another thread that talks a bit about this:

http://forums.coronalabs.com/topic/33708-swipe-left-or-right-to-change-scenes/

Touch events have a .xStart and .yStart values in addition to .eventX and eventY.  if .eventX is greater than .xStart, it’s left to right, etc.

Rob

Here’s another thread that talks a bit about this:

http://forums.coronalabs.com/topic/33708-swipe-left-or-right-to-change-scenes/

Touch events have a .xStart and .yStart values in addition to .eventX and eventY.  if .eventX is greater than .xStart, it’s left to right, etc.

Rob