Book Image

Learning Cocos2d-x Game Development

By : Siddharth Shekar
Book Image

Learning Cocos2d-x Game Development

By: Siddharth Shekar

Overview of this book

Table of Contents (19 chapters)
Learning Cocos2d-x Game Development
Credits
About the Author
Acknowledgments
About the Reviewers
www.PacktPub.com
Preface
Index

Enabling multitouch


Now, let's try the same with two fingers; we touch both fingers at the same time, anywhere on the screen. We see that the TouchesBegan() function got called twice, and when we remove each finger one by one, the TouchesEnded() function gets called one after the other.

In Windows Phone and Android, multitouch is enabled automatically. On iOS, we will have to enable it separately by adding the following below the line EAGLView *__glView in the function, (BOOL) application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions in the AppController.mm file:

[__glView setMultipleTouchEnabled:YES];