cocos2dx 2.x 竖屏

1,

xcode中General->Device Orientation只勾选Portrait。

2,

修改RootViewController.mm中下面代码:

// For ios6.0 and higher, use supportedInterfaceOrientations & shouldAutorotate instead
- (NSUInteger) supportedInterfaceOrientations
{
#ifdef __IPHONE_6_0
//return UIInterfaceOrientationMaskAllButUpsideDown;//屏蔽掉原来的
return UIInterfaceOrientationMaskPortrait;//改成这句
#endif
}

3:

将AppMacros.h中的

static cocos2d::CCSize designResolutionSize = cocos2d::CCSizeMake(1136, 640);

改成 static cocos2d::CCSize designResolutionSize = cocos2d::CCSizeMake(640, 1136);

注:此处是为了使通过CCDirector::sharedDirector()->getWinSize()得到的屏幕尺寸height>width。

 

----参考:

http://blog.csdn.net/tspangle/article/details/23847893

posted on 2014-11-04 19:03  wantnon  阅读(267)  评论(0编辑  收藏  举报

导航