Skip to content

BrushesArea beta ​

Class of @v12-engine/editor

ts
export declare class BrushesArea

The brushes: a stroke over the map raises the land, cuts cliffs, lays water and paint, scatters and erases. Made with the document, the ground, what stands on it, the markers (scattered doodads) and many things at once (the map's symmetry). The stroke going on is its own: a change cancelled or undone lets go of it

Members ​

constructor ​

ts
constructor(
    doc: MapDocument, ground: GroundArea, objects: ObjectsArea, markers: MarkersArea, batch: BatchArea);

Constructs a new instance of the BrushesArea class

beginStroke ​

ts
beginStroke(tool: BrushTool, point: Vec2, options: BrushOptions): void;

A stroke is one operation, from where the brush goes down to where it is lifted

carvePath ​

ts
carvePath(id: number, options?: {
        bank?: number;
        smooth?: number;
        tile?: number;
    }): boolean;

Carves a road along a path of the map (MapPath, by its id): the land under it made as smooth along it as a road is (its heights along the middle averaged over smooth cells each way), level across it, eased into the land around over bank cells each side; its cells painted with tile where one is given. One step of the history. False for a path the map has not, or one of fewer than two points

continueStroke ​

ts
continueStroke(point: Vec2, dt: number): void;

One step of the brush where the pointer is, dt seconds after the last one

doc ​

ts
readonly doc: MapDocument;

The map document the brushes work on

endStroke ​

ts
endStroke(): void;

Ends the stroke and commits it as one operation of the history; does nothing when none is going on

eraseKinds ​

ts
get eraseKinds(): readonly MapEraseKind[];

What the erase brush can be set to take besides everything and camps: the game's, or today's

heights ​

ts
get heights(): readonly [number, number];

The lowest and the highest the ground is raised to: the game's, or -4 to 16

landAt ​

ts
landAt(x: number, z: number): number;

How high the land of a cell is, cliffs and all (the middle of its corners' ground, and its level): what a flood goes by, and what the height under the pointer is picked as for one

stroking ​

ts
get stroking(): boolean;

Whether a brush stroke is going on: begun and not yet ended