Skip to content

PlacedTool beta ​

Class of @v12-engine/editor

ts
export declare class PlacedTool implements Tool

Puts things down one by one where it is clicked, picks one with a press on it and moves it with a drag: the lights, the effects, the points and the sounds, each as its PlacedSpec says

Members ​

constructor ​

ts
constructor(host: ToolHost, spec: PlacedSpec);

Constructs a new instance of the PlacedTool class

busy ​

ts
get busy(): boolean;

Whether a drag of one is going on: the pointer is the tool's until it ends

cancel ​

ts
cancel(): void;

Cancels a drag in the middle: the one dragged goes back to where it was

cursor ​

ts
readonly cursor = "target";

The pointer over the map is a target

escape ​

ts
escape(): boolean;

Lets go of the one picked; true when there was one

key ​

ts
key(event: KeyboardEvent): boolean;

Turns the one picked (or the next one's facing) by [ and ]; true when the key was one of those and took effect

pointerDown ​

ts
pointerDown(pointer: ToolPointer): void;

Picks and starts dragging the one under the press, or puts a new one down at the ground there

pointerMove ​

ts
pointerMove(pointer: ToolPointer): void;

Moves the one dragged with the pointer, once it has moved far enough to count as a drag; the move is one step in the history

pointerUp ​

ts
pointerUp(): void;

Ends the drag: the move is committed to the history if the pointer moved