Module dmc-gestures

A Lua module which creates Gesture Recognizers.

Usage:

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

Functions

Gesture.newLongPressGesture (view[, params]) Create a Long Press Gesture Recognizer.
Gesture.newPanGesture (view[, params]) Create a Pan Gesture Recognizer.
Gesture.newPinchGesture (view[, params]) Create a Pinch Gesture Recognizer.
Gesture.newTapGesture (view[, params]) Create a Tap Gesture Recognizer.


Functions

Gesture.newLongPressGesture (view[, params])
Create a Long Press Gesture Recognizer. creates recognizers which watch for Long Press gestures

Parameters:

  • view object Corona Display object
  • params
    • delegate object a delegate object to control this gesture (optional)
    • id string an id for this gesture, used to differentiate gestures. value is available in an Event. (default nil)
    • max_touches int maximum number of touches required for gesture. This defaults to params.touches. (default 1)
    • threshold int movement required to recognize the tap. (default 10)
    • touches int minimum number of touches required for gesture. (default 1)

Returns:

    Gesture.LongPress a Long-Press Gesture Recognizer

Usage:

  • local g = Gesture.newLongPressGesture( view )
  • local g = Gesture.newLongPressGesture( view, {id='my-longpress', touches=2}  )
Gesture.newPanGesture (view[, params])
Create a Pan Gesture Recognizer. creates recognizers which watch for Drag/Pan gestures.

Parameters:

  • view object Corona Display object
  • params
    • delegate object a delegate object to control this gesture (optional)
    • id string an id for this gesture, used to differentiate gestures. value is available in an Event. (default nil)
    • max_touches int maximum number of touches required for gesture. This defaults to params.touches. (default 1)
    • threshold int movement required to recognize the tap. (default 10)
    • touches int minimum number of touches required for gesture. (default 1)

Returns:

    Gesture.Pan a Pan Gesture Recognizer

Usage:

  • local g = Gesture.newPanGesture( view )
  • local g = Gesture.newPanGesture( view, {id='my-pan', touches=2} )
Gesture.newPinchGesture (view[, params])
Create a Pinch Gesture Recognizer. creates recognizers which watch for Pinch/Zoom gestures.

Parameters:

  • view object Corona Display object
  • params
    • delegate object a delegate object to control this gesture (optional)
    • id string an id for this gesture, used to differentiate gestures. value is available in an Event. (default nil)
    • threshold int movement required to recognize the gesture. (default 5)

Returns:

    Gesture.Pinch a Pinch Gesture Recognizer

Usage:

  • local g = Gesture.newPinchGesture( view )
  • local g = Gesture.newPinchGesture( view, { id="my-pinch", threshold=10 } )
Gesture.newTapGesture (view[, params])
Create a Tap Gesture Recognizer. creates recognizers which watch for tap-type gestures

Parameters:

  • view object Corona Display object
  • params
    • accuracy int the maximum movement allowed between taps. (default 10)
    • delegate object a delegate object to control this gesture (optional)
    • id string an id for this gesture, used to differentiate gestures. value is available in an Event. (default nil)
    • taps int minimum number of taps required for gesture. (default 1)
    • time int maximum time between taps. (default 300)
    • touches int minimum number of touches required for gesture. (default 1)

Returns:

    Gesture.Tap a Tap Gesture Recognizer

Usage:

  • local g = Gesture.newTapGesture( view )
  • local g = Gesture.newTapGesture( view, { id="my-tap", threshold=10 } )
generated by LDoc 1.4.3 Last updated 2015-05-14 11:55:03