os_lock_orientation


描述

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


语法:

os_lock_orientation(flag)

参数 描述
标识 Set to true or false to enable or disable orientation locking.


返回:

N/A(无返回值)


例如:

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.