Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Disable orientation change animation

edited September 2013 in Questions Posts: 82

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.

Tagged:

Comments

  • dave1707dave1707 Mod
    Posts: 7,468

    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.

  • Posts: 2,161

    @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.

  • Posts: 82

    @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 :|

    Thank you for your answers!

Sign In or Register to comment.