Fork me on GitHub

设置Cocos2D屏幕横向或纵向的方法

帖子地址 http://www.cocoachina.com/bbs/read.php?tid-14020.html

有时候你会发现使用Cocos2D运行的代码例子全是横屏显示的,如何纵向显示?

横屏都在Delegate中设置了类似下面这句,如果你要纵向去掉就可
[[Director sharedDirector] setDeviceOrientation:CCDeviceOrientationLandscapeLeft];

或者用以下方法

Director *director = [Director sharedDirector];
[director setLandscape:NO];//yes横屏 no竖

posted on 2012-03-10 12:45  pengyingh  阅读(291)  评论(0)    收藏  举报

导航