Cocos2d - Setting Device/Screen Orientation

前端 未结 6 1004
情话喂你
情话喂你 2021-01-15 17:31

I am new to the cocos2d API and have noticed that there are a few ways to set the screens orientation within the templates. I have not been able to figure out the correct wa

6条回答
  •  时光取名叫无心
    2021-01-15 18:22

    Modify GameConfig.h from the cocos2d template.

    #define GAME_AUTOROTATION kGameAutorotationNone
    /* original code is kGameAutorotationUIViewController. */
    

    And modify AppDelegate.m as well.

    #if GAME_AUTOROTATION == kGameAutorotationUIViewController
        [director setDeviceOrientation:kCCDeviceOrientationPortrait];
    #else
        [director setDeviceOrientation:kCCDeviceOrientationLandscapeRight];
        /* original code is "Left". */
    #endif
    

提交回复
热议问题