i have project code in cocos and cocos2d and have problem in orientation

Posted by Sukhi on Stack Overflow See other posts from Stack Overflow or by Sukhi
Published on 2010-12-27T07:08:57Z Indexed on 2010/12/27 13:53 UTC
Read the original article Hit count: 230

Filed under:
|

i have project code in cocos and cocos2d and have problem in orientation .

my game is in landscape mode part of its code in cocos2d and another one is in cocos .

cocos2d views orientations is working fine . i put this code in appdelegate.m file

-(void)orientationChanged:(NSNotification *)notification { UIDeviceOrientation orientation = [[UIDevice currentDevice] orientation];

if( orientation == UIInterfaceOrientationLandscapeLeft)
{

    [[CCDirector sharedDirector] setDeviceOrientation: kCCDeviceOrientationLandscapeRight];

} 
else if( orientation == UIInterfaceOrientationLandscapeRight) 
{

    [[CCDirector sharedDirector] setDeviceOrientation: kCCDeviceOrientationLandscapeLeft];
} 

}

but when i go to cocos code its view look good but as soon as i change the rotation LandscapeRight to LandscapeLeft my views goes in potrate mode

i wrote following code in UIViewController

  • (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { // Overriden to allow any orientation. BOOL orienationStatus=FALSE; if (interfaceOrientation ==UIInterfaceOrientationLandscapeLeft || interfaceOrientation==UIInterfaceOrientationLandscapeRight) {

        orienationStatus=TRUE;
    

    }

    return orienationStatus;

}

whats wrong in that i don't know ....

help will be appreciated .....

© Stack Overflow or respective owner

Related posts about iphone

Related posts about orientation