P
Pogmog
Guest
There is a problem that when using the function os_lock_orientation(true) on a device that is in landscape the game will be flipped 180 degrees. This has been reported in the following threads:
https://forum.yoyogames.com/index.php?threads/os_lock_orientation-issue.24398/
https://forum.yoyogames.com/index.p...self-if-its-in-the-reverse-orientation.22929/
https://forum.yoyogames.com/index.php?threads/os_lock_orientation-flips-my-game.24473/
https://forum.yoyogames.com/index.php?threads/how-to-lock-the-device-orientation.11626/
From testing the problem I have found out this:
If the device is orientated to "display_landscape", calling "os_lock_orientation(true)" will flip to "display_landscape_flipped" and vice versa.
If I tilt from landscape to portrait to landscape_flipped the resulting "display_get_orientation()" is 2 -> 1 -> 0. However, if I tilt from landscape to landscape_flipped the "display_get_orientation()" stays the same (e.g., 2 -> 2).
If I tilt from portrait to landscape and then call "display_get_orientation()" the screen will be flipped. However, if I tilt from portrait to landscape, then tilt to the other landscape orientation, and then call "display_get_orientation()" the screen does not flip.
These results are the same whether only the Game Global Setting have only "landscape" and "portrait" checked or if all four, including the flipped options, are checked.
Likely cause:
It seems that the display_orientation variable is set in relation to a tilt away from portrait and this setting is the opposite of what "os_lock_orientation(true)" acts on.
In other words, the "os_lock_orientation(true)" acts as if left-tilted-landscape is "0" and right-tilted-landscape is "2". However, calling "display_get_orientation()" shows left-tilted-landscape as "2" and right-tilted-landscape as "0". Thus, when the lock is called the screen is flipped.
Evidence:
To avoid the flipping behaviour you can turn the phone from portrait to landscape (setting the display_orientation variable to the conflicting value), then flip the phone to the alternate landscape orientation (resulting in a change of actual orientation but no change in the display_orientation variable). Calling "os_lock_orientation(true)" after doing this will not flip the screen because the display_orientation variable matches the orientation constants that the lock functionality uses.
Solution:
None that I can see. Any suggestions?
Part of the issue has been reported here: http://bugs.yoyogames.com/view.php?id=15291
https://forum.yoyogames.com/index.php?threads/os_lock_orientation-issue.24398/
https://forum.yoyogames.com/index.p...self-if-its-in-the-reverse-orientation.22929/
https://forum.yoyogames.com/index.php?threads/os_lock_orientation-flips-my-game.24473/
https://forum.yoyogames.com/index.php?threads/how-to-lock-the-device-orientation.11626/
From testing the problem I have found out this:
If the device is orientated to "display_landscape", calling "os_lock_orientation(true)" will flip to "display_landscape_flipped" and vice versa.
If I tilt from landscape to portrait to landscape_flipped the resulting "display_get_orientation()" is 2 -> 1 -> 0. However, if I tilt from landscape to landscape_flipped the "display_get_orientation()" stays the same (e.g., 2 -> 2).
If I tilt from portrait to landscape and then call "display_get_orientation()" the screen will be flipped. However, if I tilt from portrait to landscape, then tilt to the other landscape orientation, and then call "display_get_orientation()" the screen does not flip.
These results are the same whether only the Game Global Setting have only "landscape" and "portrait" checked or if all four, including the flipped options, are checked.
Likely cause:
It seems that the display_orientation variable is set in relation to a tilt away from portrait and this setting is the opposite of what "os_lock_orientation(true)" acts on.
In other words, the "os_lock_orientation(true)" acts as if left-tilted-landscape is "0" and right-tilted-landscape is "2". However, calling "display_get_orientation()" shows left-tilted-landscape as "2" and right-tilted-landscape as "0". Thus, when the lock is called the screen is flipped.
Evidence:
To avoid the flipping behaviour you can turn the phone from portrait to landscape (setting the display_orientation variable to the conflicting value), then flip the phone to the alternate landscape orientation (resulting in a change of actual orientation but no change in the display_orientation variable). Calling "os_lock_orientation(true)" after doing this will not flip the screen because the display_orientation variable matches the orientation constants that the lock functionality uses.
Solution:
None that I can see. Any suggestions?
Part of the issue has been reported here: http://bugs.yoyogames.com/view.php?id=15291