O'Reilly logo

Cocos2d-x Game Development Essentials by Gareth Jones, Arutosh Gurung, Frahaan Hussain

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

Multi-touch events

Multi-touch is set up in a similar manner of declaring the functions and creating a listener to actively listen out for touch events.

Follow these steps to implement multi-touch into a scene:

  1. Firstly, the multi-touch feature needs to be enabled in the AppController.mm file, which is located within the ios folder. To do so, add the following code line below the viewController.view = eaglView; line:
    [eaglView setMultipleTouchEnabled: YES];

    The following is what the AppController.mm file will look like:

    Multi-touch events
  2. Declare the touch functions within the game scene header file (the functions do the same thing as the single-touch equivalents but enable ...

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