In the rootviewcontroller.m file, modify the following code
Method of Shouldautorotatetointerfaceorientation
-(BOOL) Shouldautorotatetointerfaceorientation: (uiinterfaceorientation) interfaceorientation {////There is 2 ways t o support auto-rotation://-the opengl/cocos2d to//-Faster, but doesn ' t rotate the UIKit objects//-the Viewcontroller-A bit slower, but the UiKit objects is placed in the right place//#if game_autorotation
==kgameautorotationnone////Eaglview won ' t be autorotated.
Since This method should return yes to least 1 orientation,///We return Yes only in the Portrait orientation//
return (interfaceorientation = = uiinterfaceorientationportrait); #elif game_autorotation==kgameautorotationccdirector////Eaglview'll be rotated by cocos2d////Sample:autorotat E only in landscape mode//if (interfaceorientation = = uiinterfaceorientationlandscapeleft) {[[Ccdirector Shareddir
Ector] setdeviceorientation:kccdeviceorientationlandscaperight]; } else if (interfaceorientation = = Uiinterfaceorientationlandscaperight) {[[Ccdirector shareddirector] setdeviceorientation:kccdeviceorientationlandscapeleft];
}//Since This method should return yes to least 1 orientation,///We return Yes only in the Portrait orientation
return (interfaceorientation = = uiinterfaceorientationportrait);
#elif game_autorotation = = Kgameautorotationuiviewcontroller////Eaglview would be is rotated by the Uiviewcontroller// Sample:autorotate only in LANDSCPE mode////return YES for the supported orientations//Cross screen//return (Uiinterf
Aceorientationislandscape (interfaceorientation));
Return (uiinterfaceorientationisportrait (interfaceorientation));//Screen #else #error Unknown value in Game_autorotation
#endif//game_autorotation//Shold not happen return NO;
}
//
There is 2 ways to support auto-rotation:
-The Opengl/cocos2d
-Faster, but doesn ' t rotate the UIKit objects
-The Viewcontroller
-A bit slower, but the UiKit objects is placed in the right place
//
#if Game_autorotation==kgameautorotationnone
//
Eaglview won ' t be autorotated.
Since This method should return YES least 1 orientation,
We return YES only in the Portrait orientation
//
return (interfaceorientation = = uiinterfaceorientationportrait);
#elif Game_autorotation==kgameautorotationccdirector
//
Eaglview'll be rotated by cocos2d
//
Sample:autorotate only in landscape mode
//
if (interfaceorientation = = Uiinterfaceorientationlandscapeleft) {
[[Ccdirector Shareddirector] setdeviceorientation:kccdeviceorientationlandscaperight];
} else if (interfaceorientation = = uiinterfaceorientationlandscaperight) {
[[Ccdirector Shareddirector] setdeviceorientation:kccdeviceorientationlandscapeleft];
}
Since This method should return YES least 1 orientation,
We return YES only in the Portrait orientation
return (interfaceorientation = = uiinterfaceorientationportrait);
#elif Game_autorotation = = Kgameautorotationuiviewcontroller
//
Eaglview'll be rotated by the Uiviewcontroller
//
Sample:autorotate only in LANDSCPE mode
//
Return YES for the supported orientations
Return (Uiinterfaceorientationislandscape (interfaceorientation));
Return (uiinterfaceorientationisportrait (interfaceorientation));
#else
#error Unknown value in Game_autorotation
#endif//Game_autorotation
Shold not happen
return NO;
}
-(BOOL) Shouldautorotatetointerfaceorientation: (uiinterfaceorientation) interfaceorientation {
//
There is 2 ways to support auto-rotation:
-The Opengl/cocos2d
-Faster, but doesn ' t rotate the UIKit objects
-The Viewcontroller
-A bit slower, but the UiKit objects is placed in the right place
//
#if Game_autorotation==kgameautorotationnone
//
Eaglview won ' t be autorotated.
Since This method should return YES least 1 orientation,
We return YES only in the Portrait orientation
//
return (interfaceorientation = = uiinterfaceorientationportrait);
#elif Game_autorotation==kgameautorotationccdirector
//
Eaglview'll be rotated by cocos2d
//
Sample:autorotate only in landscape mode
//
if (interfaceorientation = = Uiinterfaceorientationlandscapeleft) {
[[Ccdirector Shareddirector] setdeviceorientation:kccdeviceorientationlandscaperight];
} else if (interfaceorientation = = uiinterfaceorientationlandscaperight) {
[[Ccdirector Shareddirector] setdeviceorientation:kccdeviceorientationlandscapeleft];
}
Since This method should return YES least 1 orientation,
We return YES only in the Portrait orientation
return (interfaceorientation = = uiinterfaceorientationportrait);
#elif Game_autorotation = = Kgameautorotationuiviewcontroller
//