开发者

How to enable multi touch in cocos2d?

开发者 https://www.devze.com 2022-12-11 22:10 出处:网络
Could anyone show me how开发者_Python百科 to enable multi touch in cocos2d application please? I am new to this. Really appreciate any help. Use setMultipleTouchEnabled:Yes for your UIWindow or UIView

Could anyone show me how开发者_Python百科 to enable multi touch in cocos2d application please? I am new to this. Really appreciate any help.


Use setMultipleTouchEnabled:Yes for your UIWindow or UIView, and then set the isTouchEnabled property for the layer on which you want to receive touches.


I tested on Cocos2D 1.0rc2, and in that version you must put the setMultipleTouchEnabled command in the OpenGL view (in the appdelegate class):

[glView setMultipleTouchEnabled:YES];

and in your CCLayer init function:

self.isTouchEnabled = YES;
0

精彩评论

暂无评论...
验证码 换一张
取 消