cocos2dx doesn't work correctly on iOS 5

There seems to be orientation problems with iOS5 and cocos2dx. When the device is launched (oriented to portrait) the layouts get all screwed up with somethings framed to portrait and some landscape.

It is also seen using the iPhone 5 simulator. Note this bug doesn’t show up with iOS SDK 5 and device/simulators running iOS4.

To reproduce, please run the cocos2dxBoxTest template built with iOS5 sdk and launched in the iPhone 5.0 simulator. First difference is that you’ll see it is launched in portrait mode (it is supposed to be landscape.) Then when the device is rotated to landscape, the view rotates, but the physics is wrong (the floor only covers half the screen, and the boxes just fall through on the right hand side.) Adding landscape as the only supported orientation to the Info.plist doesn’t’ solve the problem - it orients it correctly to launch landscape but the physics is still wrong…

Any help would be greatly appreciated! Thanks.

We have noticed this problem and Walzer is resolving it.

I saw that walzer checked in the fix to github yesterday! - Thank you! :slight_smile:

I’m using the latest cocos2dx but i still having this problem. do i have to get it from github?

any update on this? all my sprites and UI are messed up after upgraded to the latest xcode and iOS5. I will include screenshots for comparison tonight. i was about to submit my game to appstore but this problem occur. bad timing bad timing.

thanks in advance.

Hi, I have the same problems. How can I resolve?
I use cocos2dx 2.1.0.

Thank!

Stefano

John G wrote:

There seems to be orientation problems with iOS5 and cocos2dx. When the device is launched (oriented to portrait) the layouts get all screwed up with somethings framed to portrait and some landscape.
>
It is also seen using the iPhone 5 simulator. Note this bug doesn’t show up with iOS SDK 5 and device/simulators running iOS4.
>
To reproduce, please run the cocos2dxBoxTest template built with iOS5 sdk and launched in the iPhone 5.0 simulator. First difference is that you’ll see it is launched in portrait mode (it is supposed to be landscape.) Then when the device is rotated to landscape, the view rotates, but the physics is wrong (the floor only covers half the screen, and the boxes just fall through on the right hand side.) Adding landscape as the only supported orientation to the Info.plist doesn’t’ solve the problem - it orients it correctly to launch landscape but the physics is still wrong…
>
Any help would be greatly appreciated! Thanks.

mmm…. I have resolved, changing this method:

  • (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
    return UIInterfaceOrientationIsLandscape( interfaceOrientation );
    }

with

  • (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
    return false;
    }

wrong way?

Regards

Stefano

Stefano Campodall’Orto wrote:

Hi, I have the same problems. How can I resolve?
I use cocos2dx 2.1.0.
>
Thank!
>
>
Stefano
>
John G wrote:
> There seems to be orientation problems with iOS5 and cocos2dx. When the device is launched (oriented to portrait) the layouts get all screwed up with somethings framed to portrait and some landscape.
>
> It is also seen using the iPhone 5 simulator. Note this bug doesn’t show up with iOS SDK 5 and device/simulators running iOS4.
>
> To reproduce, please run the cocos2dxBoxTest template built with iOS5 sdk and launched in the iPhone 5.0 simulator. First difference is that you’ll see it is launched in portrait mode (it is supposed to be landscape.) Then when the device is rotated to landscape, the view rotates, but the physics is wrong (the floor only covers half the screen, and the boxes just fall through on the right hand side.) Adding landscape as the only supported orientation to the Info.plist doesn’t’ solve the problem - it orients it correctly to launch landscape but the physics is still wrong…
>
> Any help would be greatly appreciated! Thanks.