Skip to content

PortraitHost beta ​

Interface of @v12-engine/client

ts
export interface PortraitHost

What the portraits need of the client or the editor: where the files are, how to find a unit and what it looks like, a still of a type, and the stage the live ones are drawn on

Members ​

assets ​

ts
assets?: Assets;

Where the model files are

colorOf ​

ts
colorOf?(id: number): Rgb | undefined;

The team colour of an entity, for its model's team parts

kindOf ​

ts
kindOf?(type: string): string | undefined;

A unit type's kind (UnitTypeDef.kind): a building, a resource, anything not a unit, is seen whole

look ​

ts
look(type: string): (Pick<UnitLook, 'model' | 'portrait'> & {
        shapes?: readonly ShapeDef[];
    }) | undefined;

A unit type's look: its model and its portrait, and the parts it is drawn from where it has no model

materials ​

ts
materials?: ModelMaterials;

How models' materials are drawn where a model does not say (GameView.units.materials)

merge ​

ts
merge?: boolean;

Whether a model's parts are merged into one mesh where the model does not say (GameView.units.merge): yes when left out

modelOf ​

ts
modelOf?(id: number): ModelDef | undefined;

The model an entity is drawn with now, where it is not its type's (a polymorph, kit.setModel)

resolve ​

ts
resolve(unit: string | number): number | undefined;

The entity a unit's name or a ref stands for (an id is itself)

still ​

ts
still(type: string): Promise<string | undefined>;

A picture of a type's model, as a data URL or an address: nothing where the type has no model

typeOf ​

ts
typeOf(id: number): string | undefined;

The type of an entity the screen sees, or nothing