GroundArea beta
Class of @v12-engine/editor
export declare class GroundAreaThe 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
constructor(
doc: MapDocument);Constructs a new instance of the GroundArea class
cellAt
cellAt(x: number, z: number): number;The cell index (row by width, then column) of the point x, z, clamped to the map
doc
readonly doc: MapDocument;The map document the area works on
generate
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
groundAt(x: number, z: number): number;Height of the land at a point, before cliffs and water
offset
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
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
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
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
setBounds(bounds: CellRect | undefined): void;Sets the part of the map play happens in (GameMap.bounds), or makes it all of it