How to change the orientation of game during playing my game. What are the different orientation of ipad.
How to change the orientation of my game as per device orientation in ipad
(2 posts) (2 voices)-
Posted 1 year ago #
-
Hi,
have a look at the tests that come with cocos2D, especially "bug-914". The lines in the "bugViewController" are:-(void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration { CGRect rect; if(toInterfaceOrientation == UIInterfaceOrientationPortrait || toInterfaceOrientation == UIInterfaceOrientationPortraitUpsideDown) { if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) rect = CGRectMake(0, 0, 768, 1024); else rect = CGRectMake(0, 0, 320, 480 ); } else if(toInterfaceOrientation == UIInterfaceOrientationLandscapeLeft || toInterfaceOrientation == UIInterfaceOrientationLandscapeRight) { if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) rect = CGRectMake(0, 0, 1024, 768); else rect = CGRectMake(0, 0, 480, 320 ); } glView.frame = rect; }Marco
Posted 1 year ago #
Reply
You must log in to post.