AvatarBook
The avatars the frames said, by player id, and the smoothed bodies. One per game page.
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new AvatarBook(
now?):AvatarBook
now: this frame’s time (tests).
Parameters
Section titled “Parameters”() => number
Returns
Section titled “Returns”AvatarBook
Properties
Section titled “Properties”smoothedBody
Section titled “smoothedBody”
readonlysmoothedBody:SmoothedBody
A player’s smoothed body (see Play.smoothedBody): a frame’s body smoothed for its player and interpolated for this animation frame, or a player id’s (null if none yet).
Accessors
Section titled “Accessors”defaultAmount
Section titled “defaultAmount”Get Signature
Section titled “Get Signature”get defaultAmount():
number
The smoothing amount when the game gives none (true or absent): 0.5, or LOCAL_SMOOTHING for local bodies.
Returns
Section titled “Returns”number
Methods
Section titled “Methods”setLocal()
Section titled “setLocal()”setLocal(
local):void
Bodies from a camera on this same device (true) or over the network (false, the default): the lighter smoothing and interpolation, or the usual. Players start afresh.
Parameters
Section titled “Parameters”boolean
Returns
Section titled “Returns”void
note()
Section titled “note()”note(
players,t?,arrival?):void
Every frame from the host: the latest avatar of each player, and when their bodies were taken (t).
Parameters
Section titled “Parameters”players
Section titled “players”readonly PlayerFrame[]
number
arrival?
Section titled “arrival?”number
Returns
Section titled “Returns”void
of(
player):string
The avatar id of a player (an id, 1-based, or a frame): the one the child picked, or the default of the slot (fox, lion, dragon, unicorn: the 6–8 band’s, as no age is known here) before the first frame, from an older host, or for an id this SDK doesn’t know.
Parameters
Section titled “Parameters”player
Section titled “player”number | PlayerFrame
Returns
Section titled “Returns”string
posed()
Section titled “posed()”posed(
player,body,amount,interpolate?):Body
The body to draw for this player now: body smoothed (amount below 1) against the player’s previous one, then, with interpolate, at this animation frame’s time between the last two.
Parameters
Section titled “Parameters”player
Section titled “player”number
amount
Section titled “amount”number
interpolate?
Section titled “interpolate?”boolean
Returns
Section titled “Returns”smooth()
Section titled “smooth()”smooth(
player,body,amount):Body
body smoothed against this player’s previous one; the same body twice in a row is smoothed once.
Parameters
Section titled “Parameters”player
Section titled “player”number
amount
Section titled “amount”number
Returns
Section titled “Returns”takeDrawn()
Section titled “takeDrawn()”takeDrawn():
number
Animation frames the avatars were drawn in, since the last call; for stats. Frames are told apart by their time, so any number of avatars or calls in one frame count once.
Returns
Section titled “Returns”number