This is a frequently asked question. Multi-touch feature is available on both iOS & Android port since the first version of cocos2d-x. But in iOS, apple turns the switcher off by default, and offers an API to enable it manually.

iOS

Please refer to cocos2d-x/samples/Cpp/TestCpp/proj.ios/Classes/testAppDelegate.mm, line 39

[__glView setMultipleTouchEnabled:YES]

When you have a project created by xcode cocos2d-x templates, you can modify this file MyGame/proj.ios/AppController.mm as below

1- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {

2

// Override point for customization after application launch.

4

// Add the view controller's view to the window and display.

6 window = [[UIWindow alloc] initWithFrame: [[UIScreen mainScreen] bounds]];

7 EAGLView *__glView = [EAGLView viewWithFrame: [window bounds]

8 pixelFormat: kEAGLColorFormatRGBA8

9 depthFormat: GL_DEPTH_COMPONENT16_OES

10 preserveBackbuffer: NO

11 sharegroup: nil

12 multiSampling: NO

13 numberOfSamples: ];

14

[__glView setMultipleTouchEnabled:YES]; // enable multi-touch here!! It's at about line 37

16

17 // ...

18

19 return YES;

20}

Apple official document about setMultipleTouchEnabled is HERE:

Android

On android, the multi-touch is open by default. You don't need to open anything before get the touch coordinates in void MyLayer::ccTouchesBegan/Moved/Ended

Other platforms

People usually debug cocos2d-x games on windows desktop system. But sadly, there's no multi-touch support on windows. You had to connect your mobile phones and test multi-touch feature on them.

Multi-touch Test Case

We added a test case for multi-touch since v2.0. After launching TestCpp, you can enter this test case from "MultiTouchTest". The video looks like this

How to Enable Multi-Touch的更多相关文章

  1. sencha touch的开源插件和例子

    写了好久的sencha touch,没想到换工作竟然一年多没有搞了.因为项目的缘故收集了好多的组件,由于懒惰,没有整理,现在想想有点后悔了,再加上如果就这样丢弃,感觉有些遗憾,今天整理了一下放在git ...

  2. WPF- 模拟触发Touch Events

    原文:WPF- 模拟触发Touch Events 基于API: [DllImport("User32.dll")] public static extern bool Initia ...

  3. java:提示Could not initialize class sun.awt.X11GraphicsEnvironment

    前几天发现tomcat提示 Could not initialize class sun.awt.X11GraphicsEnvironment  问题.以为不验证,就没太关注,今天发现,有同事提示了个 ...

  4. Tomcat远程调试catalina.sh的配置

    #!/bin/sh # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license ...

  5. linux tomca几个配置文件及点

    --------------------推荐----配置2---------------------<Connector port="8081"executor=" ...

  6. cocod2d-x 之 CCDirector、CCScene、CCSprite

    CCDirector是控制游戏流程的主要组件. typedef enum { /// sets a 2D projection (orthogonal projection)2D投机模式 kCCDir ...

  7. 转://诊断 Grid Infrastructure 启动问题 (文档 ID 1623340.1) .

    文档内容   用途   适用范围   详细信息   启动顺序:   集群状态   问题 1: OHASD 无法启动   问题 2: OHASD Agents  未启动   问题 3: OCSSD.BI ...

  8. cocos2dx 3.17.1 导演类

    进入导演类的头文件,首先看到的是一些头文件的引用:CCPlatformMacros(适配),CCRef(继承的父类),CCVector(3.0以后的新向量),CCScene(场景),CCMath(数学 ...

  9. 写一个shell 快速启动停止你的微服务吧

    在这个微服务盛行的时代,docker获得了巨大的成功,因为我们需要在一台服务器装上N个服务. 本文不是想讨论如何使用docker,而是,在一台服务器安装了多个服务后,怎样启动方便的启动服务呢? 一.在 ...

  10. Linux(Debian) 上安装tomcat并注册服务开机自启动

    1.准备工作 a.下载tomcat linux的包,地址:http://tomcat.apache.org/download-80.cgi,我们下载的版本是8.0,下载方式如图:          b ...

随机推荐

  1. !!对python列表学习整理列表及数组详细介绍

    1.Python的数组分三种类型:(详细见 http://blog.sina.com.cn/s/blog_6b783cbd0100q2ba.html) (1) list 普通的链表,初始化后可以通过特 ...

  2. [HDU 1430] 魔板

    魔板 Time Limit: 10000/5000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submiss ...

  3. matlab添加M_map工具箱(转 http://blog.sina.com.cn/s/blog_491b86bf0100srt9.html)

    之前转载过matlab画世界地图的博文.最近正好用到.首先试了matlab自带的worldmap,感觉画出来的图形不尽如人意,比较杂乱.如下图. 略查阅了些资料,请教了Liangjing,一致推荐m_ ...

  4. spring jdbc.property的配置与使用

    jdbc.properties driver=com.mysql.jdbc.Driver url=jdbc:mysql://127.0.0.1:3306/ssi1 username=root pass ...

  5. diamond专题(三)—— diamond架构

    大家好,这次为大家带来的是diamond的架构,架构如下图所示: 对该图进行一些说明: 1.作为一个配置中心,diamond的功能分为发布和订阅两部分.因为diamond存放的是持久数据,这些数据的变 ...

  6. HDU5649 DZY Loves Sorting 线段树

    题意:BC 76 div1 1004 有中文题面 然后奉上官方题解: 这是一道良心的基础数据结构题. 我们二分a[k]的值,假设当前是mid,然后把大于mid的数字标为1,不大于mid的数字标为0.然 ...

  7. 免费的SqlServer优化辅助工具:SqlOptimize (原创)

    主要用于收集客户服务器的数据库运行情况,导出-导入到本地分析. 本工具不会修改你的数据和结构,只会读取相关数据. 1)工具软件下载 http://files.cnblogs.com/files/dud ...

  8. 【原】 Spark中Task的提交源码解读

    版权声明:本文为原创文章,未经允许不得转载. 复习内容: Spark中Stage的提交 http://www.cnblogs.com/yourarebest/p/5356769.html Spark中 ...

  9. 支持度(support)和置信度(confidence)

      支持度(Support)的公式是:Support(A->B)=P(A U B).支持度揭示了A与B同时出现的概率.如果A与B同时出现的概率小,说明A与B的关系不大:如果A与B同时出现的非常频 ...

  10. 如何使用Visual Studio 2013 创建Azure云应用

    创建 Azure 云服务 Azure 云服务包括执行应用程序所需操作的角色.当你将云服务发布到 Azure 时,每个角色将在云中的虚拟机上运行.有关如何开发 Azure 云服务的详细信息. 创建 Az ...