EasyEvents
EasyEvents =
{ [G in Gesture]: { player: number } }&object
The events of FabiPlay.on, by name, with what each listener gets. Every gesture (jump, land, squat, stand, clap, freeze, move, lane-left, lane-center, lane-right) is an event of its own, with the player who made it.
Type Declaration
Section titled “Type Declaration”start:
StartInfo
The screen started the game (late listeners still get it).
hands:
object
Every frame, the hands of each player, in fractions of the screen (0–1). aim: where each hand aims, for what it touches (see Easy.aim: the hand on the body in landscape, stretched to the whole screen in portrait). left and right: the hands as pointers, the arms’ reach stretched to the whole screen in every orientation (PlayerFrame.leftHand and rightHand). null: not seen.
hands.player
Section titled “hands.player”player:
number
hands.left
Section titled “hands.left”left:
Point|null
hands.right
Section titled “hands.right”right:
Point|null
hands.aim
Section titled “hands.aim”aim:
object
hands.aim.left
Section titled “hands.aim.left”left:
Point|null
hands.aim.right
Section titled “hands.aim.right”right:
Point|null
shape:
object
When a player’s shape changes (arms up, wide, …).
shape.player
Section titled “shape.player”player:
number
shape.shape
Section titled “shape.shape”shape:
Shape|null
players
Section titled “players”players:
object
Every frame, every player: bodies for drawAvatar and your own hit-tests.
players.players
Section titled “players.players”players:
PlayerFrame[]
pause:
object
The game is paused: stop the clock until resume. reason ‘user’: a grown-up (or a child’s crossed arms); ‘distance’: a child is too close to the screen (it resumes by itself once they step back). Fabi Play draws the pause either way.
pause.reason
Section titled “pause.reason”reason:
PauseReason
resume
Section titled “resume”resume:
Record<string,never>
Go on after a pause.
break-start
Section titled “break-start”break-start:
Record<string,never>
Fabi Play shows an ad: mute and stop the clock (the script tag mutes audio and video for you).
break-end
Section titled “break-end”break-end:
object
Go on; shown says whether an ad was shown.
break-end.shown
Section titled “break-end.shown”shown:
boolean
backdrop
Section titled “backdrop”backdrop:
object
The backdrop changed mid-game, ‘video’ (no opaque background) or ‘none’ (your own background again), or the camera image moved on the screen (view).
backdrop.backdrop
Section titled “backdrop.backdrop”backdrop:
Backdrop
backdrop.view
Section titled “backdrop.view”view:
BackdropView|null
turn:
object
Remote mode only, inside the break of break(‘turn’): the next child’s turn; players (one id) is who plays from now on. Keep each player’s score by id.
turn.players
Section titled “turn.players”players:
number[]
capabilities
Section titled “capabilities”capabilities:
object
What the screen can do changed: pictures, whether savePicture can reach a phone now (see canSavePicture).
capabilities.pictures
Section titled “capabilities.pictures”pictures:
boolean