To help you create touch controllers, LuciadLightspeed offers ALspTouchController, a base class that simplifies the process of writing your own touch controllers. This base class provides three abstract methods that allow you to indicate what points will be handled by the controller, and how to react to changes at those points:

  • touchPointAvailable: called each time a new touch point becomes available. It determines which touch points are handled by the controller.

  • touchPointMoved: called whenever one of the tracked touch points has moved. It allows you to stop tracking certain points.

  • touchPointWithDrawn: called each time a touch point is no longer available. Similar to the touchPointMoved method, it allows you to stop the tracking of certain points by this controller.

If your custom controller is tracking touch points, you have a number of utility methods at your disposal to retrieve the original, previous, and current locations of the tracked points. See the API reference documentation for more information about ALspTouchController.