os_lock_orientation

This function locks the game orientation to the device's current orientation.

Syntax:

GML Code Example

os_lock_orientation(flag)


Argument Description
flag Set to true or false to enable or disable orientation locking.


Returns: N/A


Description

With this function you can "lock" your device to the current orientation until such time as you "free" it to allow all Global Game Settings enabled orientations again. Note that you likely want to confirm the orientation is as desired before locking.


Example:

GML Code Example

if os_type == os_android || os_type == os_ios
    {
    os_lock_orientation(true);
    }
 

The above code checks the OS type and if it is either Android or an iOS then the orientation locking is flagged as true.





No Examples Submitted

Does this page need better examples? Be the first to Submit

No Edits Suggested

Is this page unclear or not descriptive enough? Suggest an edit to the page and with enough upvotes your changes will be made.

No Questions Have Been Ask

Do you have a question about this page? Ask it Here