Search code examples
cocos2d-iphonecocos2d-x-3.0

Cocos2d, How Set Device Orientation to portrait IOS


I had followed this http://www.cocos2d-x.org/wiki/Device_Orientation

but my RootViewController.mm not exactly look like that.

After i replace 'UIInterfaceOrientationMaskAllButUpsideDown' to 'UIInterfaceOrientationMaskPortrait' there is some error on main.m

my cocos2d version = cocos2d-x-3.13.1 , on iPhone 7 simulator


Solution

  • You also need to go to xcode project setting and choose device orientation. Here is a screenshot.

    enter image description here