Host · type
ScreenOrientation
What a phone has instead of a window.
Explained in Display and the host.
type ScreenOrientation = 'portrait' | 'landscape'import type { ScreenOrientation } from '@driftengine/core';In depth
A handset has no window mode, no window size a game may choose and no second display, so
DisplayControl has almost nothing to offer it. What it has instead is an orientation it
may rotate out of, a safe area that a notch, a camera cut-out or a gesture bar has taken
from the screen, and a screen that wants to sleep while somebody is holding a controller
rather than touching the glass. Those are the three, and they are here rather than folded into
the display seam because a desktop shell has no use for any of them.
Every one of them can be refused, and each says so. iOS will not lock an orientation at
all; Android will not lock one outside fullscreen; a browser with no Wake Lock API cannot keep
a screen awake. A game that is told false can lay itself out for either orientation, or warn,
or carry on — what it cannot do is find out later from a player.
Not a hot path: a layout reads the safe area on a resize, not on a frame.