Disable orientation change animation

Hi, when the orientation changes in a Codea program, the whole screen can be seen rotating into it’s new position. I was wondering if this animation can be turned off, so that the screen is immediately in the right place.

You can use supportedOrientations. See the built in manual for more info.

supportedOrientations() will disable changing the orientation. As far as I know, there is no way to disable the animation, I believe it’s built-in to iOS.

I think so, too…

you could cheat and provide your own orientation support… that’s the only thing I can think of.

@tomxp411 That’s certainly possible. You could use the Gravity vector to determine which way up the iPad was being held and apply a suitable transformation.

I have a library with the “suitable transformations” in it. It was actually designed for the opposite problem: I wanted parts of the display to follow the orientation and other parts not to. So I wrote some functions that transform the coordinate system from the current orientation (whatever it is) to some fixed orientation. But equally it could be used in reverse.

@Andrew_Stacey That’s also what I was aiming for, like in for example the Procreate application. I think I’ll use gravity then to rotate the menu alone. I tried countering the rotation with an opposite animation, but that didn’t look exactly smooth :expressionless:

Thank you for your answers!