Skip to content

1681-engine / index / OrientationLock

Type Alias: OrientationLock ​

ts
type OrientationLock = 
  | "any"
  | "natural"
  | "landscape"
  | "portrait"
  | "portrait-primary"
  | "portrait-secondary"
  | "landscape-primary"
  | "landscape-secondary";

Defined in: src/platform/orientation.ts:7

Locks the screen's orientation where the platform allows it: Android Chrome in fullscreen or as an installed app, Electron and Capacitor shells. Desktop browsers and iPhone Safari refuse or lack the API; then lockOrientation resolves false, so a game asks once and falls back to a "turn your phone" hint without try/catch of its own.

Released under the MIT License.