Skip to content

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.

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.

player: number

left: Point | null

right: Point | null

aim: object

left: Point | null

right: Point | null

shape: object

When a player’s shape changes (arms up, wide, …).

player: number

shape: Shape | null

players: object

Every frame, every player: bodies for drawAvatar and your own hit-tests.

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.

reason: PauseReason

resume: Record<string, never>

Go on after a pause.

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: object

Go on; shown says whether an ad was shown.

shown: boolean

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

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.

players: number[]

capabilities: object

What the screen can do changed: pictures, whether savePicture can reach a phone now (see canSavePicture).

pictures: boolean