Cocos2d-x项目\iOS\RootViewController.mm文件中。
函数一:
(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
return UIInterfaceOrientationIsLandscape( interfaceOrientation );
// return (UIInterfaceOrientationIsPortrait( interfaceOrientation ));
}
函数二:
- (NSUInteger) supportedInterfaceOrientations{
#ifdef __IPHONE_6_0
return UIInterfaceOrientationMaskLandscape;
// return UIInterfaceOrientationMaskPortrait;
// 直式显示: protrait
// 横式显示: landscape
#endif
}
函数三:
- (BOOL) shouldAutorotate {
returnYES;
// return NO;
}
还有最后关键的一点:
用xcode肯定知道在哪里!这里是屏幕和内容关系,模拟器图也有。
本文深入探讨了Cocos2d-x项目中iOS根视图控制器的相关配置,包括应旋转检查函数、支持的旋转方向及自旋转判断等关键功能的实现与理解。

1366

被折叠的 条评论
为什么被折叠?



