Skip to content

GroundArea beta ​

Class of @v12-engine/editor

ts
export declare class GroundArea

The ground as a whole: the size of the map, the part of it play happens in, heightmaps, new land, and what is under a place

Members ​

constructor ​

ts
constructor(
    doc: MapDocument);

Constructs a new instance of the GroundArea class

cellAt ​

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

The cell index (row by width, then column) of the point x, z, clamped to the map

doc ​

ts
readonly doc: MapDocument;

The map document the area works on

generate ​

ts
generate(options: GenerateOptions): void;

Makes new land to edit from (generateTerrain): rolling hills, and plateaus with a ramp each towards the middle. The ground, cliffs and ramps are new; the water, paint and everything on the map stay

groundAt ​

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

Height of the land at a point, before cliffs and water

offset ​

ts
offset(by: Vec2): void;

Moves everything of the map over by whole cells, its size kept (EQ17): the ground, cliffs, water and paint, what is on it, the bounds, the starts, as a grow on one side and a cut on the other (resize) does. What goes past an edge is gone; the ground at the other goes on as it was at the edge there. One step of the history

readHeightmap ​

ts
readHeightmap(pixels: ArrayLike<number>, width: number, height: number, low: number, high: number): void;

Reads a heightmap into the ground: the pixels of a picture (RGBA), dark at low and light at high

replaceTile ​

ts
replaceTile(from: number, to: number): number;

Paints every cell of one tile with another, all over the map: one step of the history. Returns how many

resize ​

ts
resize(sides: MapSides, name?: string): void;

Grows or cuts the map on any side (MapSides, cells, less than 0 cuts): what is on it moves along, what is no longer on it is gone. One step of the history

setBounds ​

ts
setBounds(bounds: CellRect | undefined): void;

Sets the part of the map play happens in (GameMap.bounds), or makes it all of it