Skip to content

MapKindDef beta ​

Interface of @v12-engine/editor

ts
export interface MapKindDef extends MapKind

A kind of thing of a game's own, as its editor has it

Members ​

color ​

ts
color?: [number, number, number];

The colour it is drawn in, each part 0 to 1. The editor's own for markers when left out

create ​

ts
create?: (at: Vec2, editor: EditorClient) => Partial<Omit<MapThing, 'id' | 'x' | 'z'>> | null;

What a new one starts with, beyond where it is put: a way it faces, a name, fields. Asked as its tool puts one down; null refuses the place (the editor says nothing: say why with editor.say)

draw ​

ts
draw?: (thing: MapThing, look: {
        selected: boolean;
        color: string;
    }) => KindShape[];

What one is drawn as on the ground, in the place of the editor's mark (a ring where it is, a tick the way it faces, and its reach): shapes in the map's own places, which the editor lays over the view

fields ​

ts
fields?: KindFieldDef[];

The game's own fields of one, set in the Inspector and kept with it (MapThing.data)

hint ​

ts
hint?: string;

A line more, for the pointer resting on its tool

icon ​

ts
icon?: string;

Its icon, on the strip of tools: by name in the editor's table of icons (EditorOptions.icons). A pin when left out

key ​

ts
key?: BindingLike;

The key that picks its tool, by its place on the keyboard: the user's to move (the action tool.thing.<id>)

reach ​

ts
reach?: number | string;

How far it reaches on the ground, drawn as a ring around it: so many cells, or the id of the field of its own that says (a number). No ring when left out