Host · class

BrowserScreenPresentation

Explained in Display and the host.

class BrowserScreenPresentation implements ScreenPresentation
import { BrowserScreenPresentation } from '@driftengine/core';

Constructor

new

constructor()

Installs one stylesheet, once, and that is the only side effect in this file.

More

env(safe-area-inset-*) cannot be read from script directly — it is only valid inside a CSS declaration — so the values are copied into custom properties on the root element and read back through getComputedStyle. The alternative is a hidden probe element whose padding is measured, which costs a layout on every read and a node in every consumer's tree.

Methods

orientation

orientation(): ScreenOrientation

lockOrientation

lockOrientation(orientation: ScreenOrientation | null): Promise<boolean>
ParameterTypeDescription
orientationScreenOrientation | null

safeArea

safeArea(): SafeAreaInsets

keepAwake

keepAwake(on: boolean): Promise<boolean>
ParameterTypeDescription
onboolean