Events
Events =
object
The events of Play.on, by name: each listener gets the host’s message of that type.
Properties
Section titled “Properties”frame:
Extract<HostMessage, {type:"frame"; }>
Every camera frame (about 30 a second): each player’s body, hands, shape, lane and avatar.
gesture
Section titled “gesture”gesture:
Extract<HostMessage, {type:"gesture"; }>
A player made a movement: jump, land, squat, stand, clap, freeze, move, lane-left/center/right.
pause:
Extract<HostMessage, {type:"pause"; }>
The game is paused (reason: ‘user’, or ‘distance’ when a child is too close): stop the clock until resume.
resume
Section titled “resume”resume:
Extract<HostMessage, {type:"resume"; }>
Go on after a pause.
break-start
Section titled “break-start”break-start:
Extract<HostMessage, {type:"break-start"; }>
Fabi Play is showing a break: mute, stop the clock, until break-done.
break-done
Section titled “break-done”break-done:
Extract<HostMessage, {type:"break-done"; }>
The break is over (shown: whether an ad was shown): unmute and go on.
backdrop
Section titled “backdrop”backdrop:
Extract<HostMessage, {type:"backdrop"; }>
What is behind the game changed, or where its video is: see Play.backdrop and Play.view.
turn:
Extract<HostMessage, {type:"turn"; }>
Remote mode only (input ‘remote’), inside the break of a break(‘turn’): the next child’s turn, the same game goes on with this one player (see Play.players). Keep each player’s score by id. The SDK passes on only a turn to the next child in Play.turns, while a ‘turn’ break is under way; it drops any other.
capabilities
Section titled “capabilities”capabilities:
Extract<HostMessage, {type:"capabilities"; }>
What the screen can do for the game changed: pictures, whether savePicture can reach a phone now (see Play.canSavePicture). Only when it changes.
cursor
Section titled “cursor”cursor:
Extract<HostMessage, {type:"cursor"; }>
Remote mode with “remoteCursor”: true: the cursor the arrows move (x, y in fractions of the page, down while OK is held). Nothing to do with it: the SDK already makes the pointer and mouse events a Magic Remote would.