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’).
Properties
Section titled “Properties”backdrop?
Section titled “backdrop?”
readonlyoptionalbackdrop?:Backdrop
What is behind the game now: ‘video’ (mirror mode) or ‘none’.
readonlyoptionalview?:BackdropView|null
Where the camera image is on the screen, in fractions; null if unknown.
orientation?
Section titled “orientation?”
readonlyoptionalorientation?:Orientation
The screen’s orientation at the start (‘landscape’ if unknown): in ‘portrait’ the hands aim (see Engine.hands).
safeArea?
Section titled “safeArea?”
readonlyoptionalsafeArea?:SafeArea
What a phone’s notch and home bar cover, fractions of the viewport (see Engine.safeArea).
muted?
Section titled “muted?”
readonlyoptionalmuted?:boolean
The screen’s sound is off.
device?
Section titled “device?”
readonlyoptionaldevice?:TierHint|null
What the screen knows about the device (init.device): a starting tier and the display’s rate.
Methods
Section titled “Methods”on(
event,listener): () =>void
Listens to the host’s events; returns a function that stops listening.
Parameters
Section titled “Parameters”string
listener
Section titled “listener”(m) => void
Returns
Section titled “Returns”() => void
toScreen()
Section titled “toScreen()”toScreen(
p):Point
A body point on the screen, in fractions (see the SDK’s toScreen).
Parameters
Section titled “Parameters”Returns
Section titled “Returns”smoothedBody()?
Section titled “smoothedBody()?”
optionalsmoothedBody(who,options?):Body|null
A player’s body smoothed and interpolated as the SDK draws avatars.
Parameters
Section titled “Parameters”number | PlayerFrame
options?
Section titled “options?”smooth?
Section titled “smooth?”number | boolean
interpolate?
Section titled “interpolate?”boolean
Returns
Section titled “Returns”Body | null
avatarOf()?
Section titled “avatarOf()?”
optionalavatarOf(player):string
The avatar id a player picked.
Parameters
Section titled “Parameters”player
Section titled “player”number | PlayerFrame
Returns
Section titled “Returns”string
reportStats()?
Section titled “reportStats()?”
optionalreportStats(stats):void
Debug: how the game draws now, for the simulator’s status line (the SDK sends it only when asked).
Parameters
Section titled “Parameters”number
renderer?
Section titled “renderer?”string
Returns
Section titled “Returns”void