Bug or not? Orientation change UI (Mask) rotation animation...

Hi,

As I’ve started actively working with Corona, I’ve just noticed that problem last night.

When the device orientation is changed, contents of the OpenGL canvas rotated instantly while it’s followed by the native UI rotation animation. Sampled in 1st image below.

When using native orientation support I was expecting default rotation behavior where both rotated at once. As illustrated in 2nd image below.

Also, some other apps such as Angry Birds appears to be disabled that rotation animation which is also ok. Contents rotated instantly as Corona does. But there is no following mask animation.

I found few threads over this but none of them concluded with a solution.

Following is a solution for Unity, based on disabling the keyboard…

iPhoneKeyboard.autorotateToPortrait = false;
iPhoneKeyboard.autorotateToPortraitUpsideDown = false;
iPhoneKeyboard.autorotateToLandscapeLeft = false;
iPhoneKeyboard.autorotateToLandscapeRight = false;

Current configuration docs states we can fix the canvas (content statement in build.settings) and allow only the UI rotate. If we had access to direct opposite of this by fixing the UI but allowing to content roatate, that might also work…

I think following property might help fixing that also…

  • (void)setStatusBarOrientation:(UIInterfaceOrientation)interfaceOrientation animated:(BOOL)animated

Parameters
interfaceOrientation
A specific orientation of the status bar. See UIInterfaceOrientation for details. The default value is UIInterfaceOrientationPortrait.

animated
YES if the transition to the new orientation should be animated; NO if it should be immediate, without animation. [import]uid: 10478 topic_id: 9803 reply_id: 309803[/import]

Any comments? [import]uid: 10478 topic_id: 9803 reply_id: 35998[/import]

Here is a code supposedly fixes this, sample for two orientations…

  • (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
    if(interfaceOrientation == UIInterfaceOrientationPortrait){
    return NO;
    }
    if(interfaceOrientation == UIInterfaceOrientationPortraitUpsideDown){
    return NO;
    }
    return YES;
    }

If that can be included somehow, Corona’s current native orientation changes (which are instant) will be also followed by UI disabling the animation…

Also, while waiting for the good folks @ ansca consider this, I have gone ahead and created a plug’n play library to fix this :slight_smile:

I’m doing few final tweaks and hopefully post the code to the code exchange sometime tomorrow…

E. [import]uid: 10478 topic_id: 9803 reply_id: 36682[/import]

Have you figured this out? I also am looking to just let the screen flip Angry Birds style with no animated rectangle. [import]uid: 22392 topic_id: 9803 reply_id: 36780[/import]

@noahm26 Actualy I did, just posted to code exchange…

http://developer.anscamobile.com/code/proper-orientation-rotation-animation

It is not instant as we cannot disable UI animation. And if you lock the UI to disable the animation, when using status bar or native pop-up dialogs they will be upside down…

If you want instant rotations and NOT using native dialogs, just use the native orientation support & lock theUI to single initial orientation.

E. [import]uid: 10478 topic_id: 9803 reply_id: 36789[/import]

PixelEnvision,

If you want instant rotations and NOT using native dialogs, just use the native orientation support & lock theUI to single initial orientation.

I’m sorry, I can’t find how to lock the UI and at the same time allow the corona canvas to auto-rotate. Can you please tell what parameters should be used in build.settings for that? [import]uid: 13989 topic_id: 9803 reply_id: 85493[/import]

I’d like to know too. How do I instant rotate on iOS without the rotating black mask that seems to always be there? [import]uid: 99244 topic_id: 9803 reply_id: 85697[/import]

+1

Any way to disable the default orientation animation? [import]uid: 33608 topic_id: 9803 reply_id: 102980[/import]