Skip to content

GroundView beta ​

Class of @v12-engine/client/lite-views

ts
export declare class GroundView

The ground of a terrain on this renderer, redrawn as the terrain changes: the client's TerrainView member for member, its cliffs, rocks, water and waterfalls

Members ​

constructor ​

ts
constructor(renderer: Renderer, terrain: Terrain, looks: GroundLooks | undefined, works: GroundWorks);

Constructs a new instance of the GroundView class

Parameters ​

  • looks: of the tiles of the game, by their index in the paint (see groundLooks): their textures, and their colours
  • works: where the ground's textures made in code are made and kept: its app's (ClientRuntime.ground)

backdrop ​

ts
set backdrop(colour: Readonly<Rgb>);

The colour behind everything, which the water mirrors seen from low over it (the renderer's clear colour)

darkensBeyond ​

ts
get darkensBeyond(): boolean;

set darkensBeyond(on: boolean);

Whether the ground darkens what is beyond the bounds of play itself (GameMap.bounds): yes, unless the fog of war draws it (the renderer's world.beyond)

dispose ​

ts
dispose(): void;

Takes the ground, its water and its paints out of what is drawn and frees them

drawn ​

ts
get drawn(): {
        ground: boolean;
        cliffs: number;
        water: number;
    };

What is drawn now, counted: the parts of the walls of cliffs with their rocks' batches, and the parts of water

frame ​

ts
frame(dt: number): void;

Every frame: the water flows

groundColors ​

ts
groundColors(): CellGroundColors;

The colours of the ground as it is drawn now (CellGroundColors): each tile's by its index in the paint, and the unpainted ground's by its slope and height. What grass takes the colour of the ground under it from

log ​

ts
log: Logger;

Where it says what went wrong: the log of the game it is part of, once that has taken it

rebuild ​

ts
rebuild(): void;

After the terrain became another size (Terrain.replace): the mesh is made again, and all of it drawn

rings ​

ts
readonly rings: GroundRingsApi;

The circles laid on the ground as it is drawn, by name (GroundRingsApi): the first GROUND_RINGS_MAX drawn

setGrid ​

ts
setGrid(on: boolean): void;

Draws lines between the cells of the ground, or not

setLooks ​

ts
setLooks(looks: GroundLooks): void;

Draws the tiles with other looks: another game's, or the tiles of another map. The whole ground is drawn again

setOverlay ​

ts
setOverlay(pixels: Uint8Array | null): void;

Lays a colour over each cell of the ground, RGBA a cell, or takes it away

setWater ​

ts
setWater(look?: WaterLook): void;

Draws the water as the map says it looks (see WaterLook): its shading; its mesh where the water's cells changed

setWaveDetail ​

ts
setWaveDetail(allowed: boolean): void;

Waves on the water where the quality allows them (its effects above low): the client says, as that changes

texturesReady ​

ts
get texturesReady(): Promise<void>;

Settles once every texture of the looks laid last is drawn: those made in a worker, and the files. What a loading screen can wait for, so the ground does not come in in its colours first

update ​

ts
update(patch?: GroundPatch): void;

Redraws the ground and the water from the terrain as it is now: all of it, or what a change to the cells of patch can have changed (see GroundBuffers)

waterfalls ​

ts
readonly waterfalls: WaterfallView;

The waterfalls: found where the water spills over, and those placed by hand (waterfalls.setPlaced)

waterLight ​

ts
get waterLight(): {
        sun: Rgb;
        sky: Rgb;
    };

The sun's and the sky's light as the water's highlights take them (Babylon's light.specular times its intensity: white times it unless a game says otherwise). The renderer's sun and sky carry their diffuse light alone

wavesDrawn ​

ts
get wavesDrawn(): boolean;

Whether the water's waves are drawn now: the look has them and the quality allows them