Class Gesture.Pan

Pan Gesture Recognizer Class.

gestures to recognize drag and pan motions.

Inherits from:

Usage:

     local Gesture = require 'dmc_gestures'
     local view = display.newRect( 100, 100, 200, 200 )
     local g = Gesture.newPanGesture( view )
     g:addEventListener( g.EVENT, gHandler )

Getters and Setters

.threshold () the distance a touch must move to count as the start of a pan (number).
.touches () minimum number of touches required for gesture (int).
.max_touches () the maximum number of touches to recognize (int).
.velocity () the velocity of the pan gesture motion (number).

Class Constants

Gesture.Pan.EVENT Event name constant.
Gesture.Pan.GESTURE Event type constant, gesture recognized.


Getters and Setters

.threshold ()
the distance a touch must move to count as the start of a pan (number).

Usage:

  • print( gesture.threshold )
  • gesture.threshold = 10
.touches ()
minimum number of touches required for gesture (int).

Usage:

  • print( gesture.touches )
  • gesture.touches = 2
.max_touches ()
the maximum number of touches to recognize (int).

Usage:

  • print( gesture.max_touches )
  • gesture.max_touches = 10
.velocity ()
the velocity of the pan gesture motion (number). Get Only

Usage:

    print( pan.velocity )

Class Constants

Gesture.Pan.EVENT
Event name constant.
  • EVENT

Usage:

  • gesture:addEventListener( gesture.EVENT, handler )
  • gesture:removeEventListener( gesture.EVENT, handler )
Gesture.Pan.GESTURE
Event type constant, gesture recognized. this type of event is sent out when a Gesture Recognizer has recognized the gesture
  • GESTURE

Usage:

     local function handler( event )
     	local gesture = event.target
     	if event.type == gesture.GESTURE then
     		-- we have our event !
     	end
     end
generated by LDoc 1.4.3 Last updated 2015-05-14 11:55:03