1
votes

before to update my cocos2d 1.0.1 to 2.0rc1 in my app, I was calling [[CCDirector sharedDirector] setDeviceOrientation:(ccDeviceOrientation)currentOrientation]; into some scenes when detected one change on orientation and then load other scene in portrait or lanscape depending the currentOrientation.

But now I don't have any idea about how I can do it.

2

2 Answers

2
votes

Orientation setOrientation ( Orientation orientation )
Callback by CCDirector for change device orientation.

The defination of orientation which CCDirector want change to.

Returns The actual orientation of the application.

1
votes

Open AppDelegate.m and locate this method:

// Supported orientations: Landscape. Customize it for your own needs
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    return UIInterfaceOrientationIsLandscape(interfaceOrientation);
}

Return YES for all the orientations your app supports.