我想使用 C++ 在 cocos2d-x 中启用多点触控模式。有与如何在 cocos2d 上启用它相关的答案,但我想在 cocos2d-x 中启用它。任何帮助将不胜感激
最佳答案
我自己得到了答案。为了启用多点触控,只需转到您的 AppController.mm 然后在创建 EAGL View 后的 didFinishLaunchingWithOptions 函数中添加以下代码。
[__glView setMultipleTouchEnabled:YES];
所以现在函数应该是这样的
(BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary
*)launchOptions {
// Override point for customization after application launch.
// Add the view controller's view to the window and display.
window = [[UIWindow alloc] initWithFrame: [[UIScreen mainScreen] bounds]];
EAGLView *__glView = [EAGLView viewWithFrame: [window bounds]
pixelFormat: kEAGLColorFormatRGBA8
depthFormat: GL_DEPTH_COMPONENT16
preserveBackbuffer: NO
sharegroup: nil
multiSampling: NO
numberOfSamples:0 ];
[__glView setMultipleTouchEnabled:YES];
// Use RootViewController manage EAGLView
viewController = [[RootViewController alloc] initWithNibName:nil bundle:nil];
viewController.wantsFullScreenLayout = YES;
viewController.view = __glView;
//continued.....
关于c++ - 如何使用 C++ 在 cocos2d-x ios 游戏中启用多点触控,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21576101/