Skip to content

Latest commit

 

History

History
41 lines (26 loc) · 1.32 KB

gestureListener.markdown

File metadata and controls

41 lines (26 loc) · 1.32 KB

simple_gesture.gestureListener()

 
Type function
Library simple_gesture.*
Return value String, Boolean, nil
Keywords simple, gesture, event, listener
See also Sample code

Overview

This function is called within a touch listener, and at the end of the touch event returns the recognized gesture (or False).

Syntax

simple_gesture.gestureListener( event )
event (required)

Table. The event parameter to the touch listener.

Examples

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)