AvatarRenderer
createAvatarRenderer’s result: avatars drawn on a canvas of their own.
Properties
Section titled “Properties”renderer
Section titled “renderer”
readonlyrenderer:Renderer
The renderer in use: a GL one is replaced by Canvas 2D (on a fresh canvas) after 3 s of context loss.
readonlykind:RendererKind
Its kind: ‘webgl2’, ‘webgl1’ or ‘canvas2d’.
readonlylost:boolean
The GL context is lost right now (nothing is drawn until it comes back, or Canvas 2D takes over).
canvas
Section titled “canvas”
readonlycanvas:HTMLCanvasElement
The canvas drawn in: after a switch to Canvas 2D a fresh one, in the old one’s place in the page.
Methods
Section titled “Methods”draw()
Section titled “draw()”draw(
players,box):void
Clears the canvas and draws each player’s avatar, posed like their body (smoothed and interpolated per player unless the options say not), with its name tag. box: where player space (0–1) lands, in drawing units. Call it every animation frame.
Parameters
Section titled “Parameters”players
Section titled “players”readonly AvatarPlayer[]
Returns
Section titled “Returns”void
clear()
Section titled “clear()”clear():
void
An empty canvas (nothing to draw this frame).
Returns
Section titled “Returns”void
reset()
Section titled “reset()”reset():
void
Forget the players’ previous bodies (a new scene).
Returns
Section titled “Returns”void
destroy()
Section titled “destroy()”destroy():
void
Frees the renderer and its textures.
Returns
Section titled “Returns”void