O'Reilly logo

Corona SDK HOTSHOT by Nevin Flanagan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Tracking multiple touches

The first thing we will do is to construct a list that contains all currently active touch objects and their locations. It will use its own touch listener to stay up to date with any touch event that reaches the Runtime target (so buttons and other objects that return true in their touch listeners will not affect it).

Getting ready

After you've copied your project directory from the version 0 contents, create a text file at the top level of your project called touches.lua and open it.

Getting on with it

This module will allow the user to iterate through all the currently active touches.

Enabling multiple touches

Since this file exists to track multiple simultaneous touches, it should guarantee that Corona will track these touches; ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required