Skip to content

1681-engine / index / onFullscreenChange

Function: onFullscreenChange() ​

ts
function onFullscreenChange(fn, doc?): () => void;

Defined in: src/platform/fullscreen.ts:82

Calls fn(isFullscreen) whenever the page enters or leaves fullscreen — by the game or by the player pressing Esc, which no game code sees otherwise. Returns the unsubscribe.

Parameters ​

ParameterType
fn(fullscreen) => void
docFullscreenDocument | null

Returns ​

() => void

Released under the MIT License.