Skip to content

Cocos2D needs to support all 'supportedInterfaceOrientations' options #891

Open
@Ben-G

Description

@Ben-G

Currently the supported interface orientations are determined by the CCNavigationController inside CCAppDelegate:

-(NSUInteger)supportedInterfaceOrientations
{
    if ([_screenOrientation isEqual:CCScreenOrientationAll])
    {
        return UIInterfaceOrientationMaskAll;
    }
    else if ([_screenOrientation isEqual:CCScreenOrientationPortrait])
    {
        return UIInterfaceOrientationMaskPortrait | UIInterfaceOrientationMaskPortraitUpsideDown;
    }
    else
    {
        return UIInterfaceOrientationMaskLandscape;
    }
}

The supported screen orientation is determined by the screenOrientation property of CCNavigationController which only has three valid values:

NSString* const CCScreenOrientationLandscape = @"CCScreenOrientationLandscape";
NSString* const CCScreenOrientationPortrait = @"CCScreenOrientationPortrait";
NSString* const CCScreenOrientationAll = @"CCScreenOrientationAll"

If games want to restrict the supported device orientation to only one orientation (e.g. LandscapeLeft) the Cocos2D source code needs to be modified to change the implementation of the supportedInterfaceOrientations method.

CCNavigationController should expose all possible supported device orientations, either by adding more string constants or by another solution.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions