Take the 2-minute tour ×

I have a Menu Scene that I would like to be Portrait Only, then I have a gamescene that I would like to only allow landscape-home-button-right but I can't for the life of me figure it out. I tried adding shouldAutoRotate.. to the CCScene but that seems to only work on the RootViewController. How can I stop autorotation within the CCScene? Thank you for any help!

I'm using Cocos2D 2.0.

share|improve this question

1 Answer 1

up vote 0 down vote accepted

I can propose you to do next steps: 1. Create a singleton that manage your orientation depending on what scene is running. 2. When you enter a new scene you should say to this singleton what orientation this scene support 3. To your app delegate add something like this:

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
    return [[YourSingleton manager] supportingInterfaceOrientation];

    return [[YourSingleton manager] supportingInterfaceOrientation];

I did not test this before but it should work.

share|improve this answer
Thanks, that actually makes a lot of sense and is pretty elegant. Thank you, I will implement this later! –  mkral Oct 24 '12 at 15:06

Your Answer


