Skip to content

Portraits beta ​

Class of @v12-engine/client/common

ts
export declare class Portraits

The portraits of the client (client.portraits) or of the editor: box(canvas) is a portrait box (one target, what it shows changed as wanted), show(canvas, spec) a box showing one portrait until stopped. The HUD's faces, the dialog box's and a game's own are shown this way

Members ​

constructor ​

ts
constructor(host: PortraitHost);

Constructs a new instance of the Portraits class

box ​

ts
box(canvas: HTMLCanvasElement, options?: Pick<PortraitOptions, 'every' | 'still' | 'onDrawn'>): PortraitBox;

A portrait box on a canvas, empty until it is asked to show someone (see PortraitBox)

dispose ​

ts
dispose(): void;

Every box taken away, and the stage: the client is put away

liveCount ​

ts
get liveCount(): number;

How many boxes show a live portrait now

show ​

ts
show(canvas: HTMLCanvasElement, spec: PortraitSpec, options?: PortraitOptions): PortraitShown;

Shows a portrait on a canvas until what it gives back is stopped (see the top of this file), drawn as options say

targetCount ​

ts
get targetCount(): number;

How many render targets the portraits hold now: one a box that shows, or has shown, a live portrait