Type | function |
Library | simple_gesture.* |
Return value | String, Boolean, nil |
Keywords | simple, gesture, event, listener |
See also | Sample code |
This function is called within a touch listener, and at the end of the touch event returns the recognized gesture (or False).
simple_gesture.gestureListener( event )
Table. The event parameter to the touch listener.
local simple_gesture = require 'plugin.simple_gesture'
-- Add gesture listener to the background
local background = display.newRect(0, 0, display.contentWidth, dispay.contentHeight)
function background:touch(event)
-- Call this before doing anything else in the touch listener
local gestureResult = simple_gesture.gestureListener(event)
print(gestureResult)
end
background:addEventListener("touch", background)