How to Enable Multi-Touch
来源:互联网 发布:java gbk转utf8 乱码 编辑:程序博客网 时间:2024/04/30 23:01
How to Enable Multi-Touch
- How to Enable Multi-Touch
- iOS
- Android
- Other platforms
- Multi-touch Test Case
The Multi-touch features have been available on both iOS & Android since the first version of cocos2d-x. In iOS, Apple turns multi-touch off by default. Use the API to enable it manually.
iOS
Please refer to cocos2d-x/tests/cpp-tests/proj.ios/Classes/testsAppDelegate.mm
, line 60:
1[eaglView setMultipleTouchEnabled:YES];
You can modify this file MyGame/proj.ios/AppController.mm
:
12345678910111213141516171819- application:application didFinishLaunchingWithOptions:launchOptions { // Override point for customization after application launch. // Add the view controller’s view to the window and display. window = initWithFrame: bounds]]; EAGLView \**glView = [EAGLView viewWithFrame: [window bounds] pixelFormat: kEAGLColorFormatRGBA8 depthFormat: GL\_DEPTH\_COMPONENT16\_OES preserveBackbuffer: NO sharegroup: nil multiSampling: NO numberOfSamples: 0 ]; [_glView setMultipleTouchEnabled:YES]; // enable multi-touch here![]() It’s at about line 37 // …return YES;}
Apple official document about setMultipleTouchEnabled
.
Android
On android, the multi-touch is open by default. You don’t need to open anything before get the touch coordinates invoid 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”. There is avideo.
- How to Enable Multi-Touch
- How to use Multi-touch in Android 2 --转载
- How to enable web condor?
- How to enable navigation arrows
- How to enable the debugfs
- how to enable debug in eclipse + weblogic
- how to enable sql dependency output cache
- How to enable SSO on domino server
- How to enable SSL on domino server
- How to enable email notification of commits
- How to enable Windows Installer logging
- How to enable DNN Site Log
- How to enable Oracle listener tracing
- How to enable scanner on CN3 device
- How To Enable Apache Modules in Ubuntu
- How to enable directory listing in tomcat
- Android 4.0 How to enable Bluetooth PANU
- How to enable IP Forwarding in Linux
- Java 不同类型属性在字节码文件class中
- EventDispatcher Mechanism
- 杀人事件测你的潜意识??
- impdp 导入物化视图(mv)时报错 :ORA-31685: Object type MATERIALIZED_VIEW
- linux下如何恢复rm命令删除的文件
- How to Enable Multi-Touch
- Codeforces 379D. New Year Letter【动态规划、暴力枚举】
- POJ 1952 BUY LOW, BUY LOWER DP记录数据
- How to Create a Customized Keylayout for Any USB or Bluetooth Keyboard (ROOTED)
- [Windows问题-4] C#读取excel文件
- SQLServer 数据库还原中的孤立用户问题
- IOS 传值 总结
- 列表
- dfsdfsdgsd