Skip to content

PlayLike

What the engine needs of the SDK: the Play object of connect() or the script tag’s FabiPlay (Easy). Both have on, toScreen, smoothedBody and avatarOf; the engine listens to both kinds of events (‘frame’ and ‘players’, ‘break-done’ and ‘break-end’).

readonly optional backdrop?: Backdrop

What is behind the game now: ‘video’ (mirror mode) or ‘none’.


readonly optional view?: BackdropView | null

Where the camera image is on the screen, in fractions; null if unknown.


readonly optional orientation?: Orientation

The screen’s orientation at the start (‘landscape’ if unknown): in ‘portrait’ the hands aim (see Engine.hands).


readonly optional safeArea?: SafeArea

What a phone’s notch and home bar cover, fractions of the viewport (see Engine.safeArea).


readonly optional muted?: boolean

The screen’s sound is off.


readonly optional device?: TierHint | null

What the screen knows about the device (init.device): a starting tier and the display’s rate.

on(event, listener): () => void

Listens to the host’s events; returns a function that stops listening.

string

(m) => void

() => void


toScreen(p): Point

A body point on the screen, in fractions (see the SDK’s toScreen).

Point

Point


optional smoothedBody(who, options?): Body | null

A player’s body smoothed and interpolated as the SDK draws avatars.

number | PlayerFrame

number | boolean

boolean

Body | null


optional avatarOf(player): string

The avatar id a player picked.

number | PlayerFrame

string


optional reportStats(stats): void

Debug: how the game draws now, for the simulator’s status line (the SDK sends it only when asked).

number

string

TierName

void