PortraitHost beta
Interface of @v12-engine/client
export interface PortraitHostWhat 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
assets?: Assets;Where the model files are
colorOf
colorOf?(id: number): Rgb | undefined;The team colour of an entity, for its model's team parts
kindOf
kindOf?(type: string): string | undefined;A unit type's kind (UnitTypeDef.kind): a building, a resource, anything not a unit, is seen whole
look
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
materials?: ModelMaterials;How models' materials are drawn where a model does not say (GameView.units.materials)
merge
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
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
resolve(unit: string | number): number | undefined;The entity a unit's name or a ref stands for (an id is itself)
still
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
typeOf(id: number): string | undefined;The type of an entity the screen sees, or nothing