Skip to content

GameToolDef beta ​

Interface of @v12-engine/editor

ts
export interface GameToolDef

A tool of a game's own, next to the editor's (EditorScene.tools): lanes for a MOBA, the spawn of a wave. Made once with the editor, and handed the pointer and the keys while it is picked. It changes the map through host.editor only, so that what it does undoes like the rest

Members ​

actions ​

ts
actions?: ActionDef<EditorClient>[];

Keys of its own: actions that count while it is picked, asked before the editor's (so it can take any key then), listed with the editor's keys under the heading each says (group) and the user's to move. run is handed the editor

hint ​

ts
hint?: string;

A line more for the pointer resting on its button

icon ​

ts
icon?: string;

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

id ​

ts
id: string;

The tool's id, unique among the game's tools

key ​

ts
key?: BindingLike;

The key that picks it, by its place on the keyboard ('KeyO', or 'O', 'Shift+R'): on its icon's tooltip and in the list of every key, where the one who uses the editor can put it elsewhere (the action tool.custom.<id>). No key when left out

make ​

ts
make(host: ToolHost): Tool;

Makes the tool once the editor is there, given what the editor is to a tool

name ​

ts
name: string;

What its button says, and a line more for the pointer resting on it

options ​

ts
options?: ToolOptionDef[];

What it can be set to, on the bar over the scene while it is picked: fields as a game's own on a map are (a number, words, a toggle, one of a few, a unit type…), drawn by the editor and kept by it while it is open. The tool reads them (host.tool.optionsOf(id)), code sets them (editor.tool.setOption)

panel ​

ts
panel?: Own<{
        client: EditorClient;
    }>;

A piece of the game's own on that bar, after its options: a component, or an element it draws into (mount), given the editor