Module dmc-touchmanager

A Lua module to patch multitouch in Corona SDK.

Usage:

     local TouchMgr = require 'dmc_touchmanager'
     local o = createDisplayObject( color )
     TouchMgr.register( o )

Functions

TouchMgr.register (t_obj[, handler]) register a Display Object and handler.
TouchMgr.unregister (t_obj[, handler]) unregister a Display Object and handler.
TouchMgr.setFocus (t_obj, event_id) sets focus on an object for a single touch event.
TouchMgr.unsetFocus (t_obj, event_id) removes focus on an object for a single touch.


Functions

TouchMgr.register (t_obj[, handler])
register a Display Object and handler. puts Touch Manager in control of touch events for this object.

Parameters:

  • t_obj object a Corona-type object
  • handler the function or object to handle 'touch' events. if missing, will default to t_obj (optional)
TouchMgr.unregister (t_obj[, handler])
unregister a Display Object and handler. removes Touch Manager control of touch events for this object.

Parameters:

  • t_obj a Corona-type object
  • handler the function or object to handle 'touch' events. if missing, will default to t_obj (optional)
TouchMgr.setFocus (t_obj, event_id)
sets focus on an object for a single touch event. ensures touch event is locked to this touch object.

Parameters:

  • t_obj object a Corona-type object
  • event_id id of the touch event
TouchMgr.unsetFocus (t_obj, event_id)
removes focus on an object for a single touch. removes touch event lock on this touch object.

Parameters:

  • t_obj object a Corona-type object
  • event_id id of the touch event
generated by LDoc 1.4.3 Last updated 2015-05-14 11:55:03