GroundView beta
Class of @v12-engine/client/lite-views
export declare class GroundViewThe 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
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 (seegroundLooks): their textures, and their coloursworks: where the ground's textures made in code are made and kept: its app's (ClientRuntime.ground)
backdrop
set backdrop(colour: Readonly<Rgb>);The colour behind everything, which the water mirrors seen from low over it (the renderer's clear colour)
darkensBeyond
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
dispose(): void;Takes the ground, its water and its paints out of what is drawn and frees them
drawn
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
frame(dt: number): void;Every frame: the water flows
groundColors
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
log: Logger;Where it says what went wrong: the log of the game it is part of, once that has taken it
rebuild
rebuild(): void;After the terrain became another size (Terrain.replace): the mesh is made again, and all of it drawn
rings
readonly rings: GroundRingsApi;The circles laid on the ground as it is drawn, by name (GroundRingsApi): the first GROUND_RINGS_MAX drawn
setGrid
setGrid(on: boolean): void;Draws lines between the cells of the ground, or not
setLooks
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
setOverlay(pixels: Uint8Array | null): void;Lays a colour over each cell of the ground, RGBA a cell, or takes it away
setWater
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
setWaveDetail(allowed: boolean): void;Waves on the water where the quality allows them (its effects above low): the client says, as that changes
texturesReady
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
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
readonly waterfalls: WaterfallView;The waterfalls: found where the water spills over, and those placed by hand (waterfalls.setPlaced)
waterLight
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
get wavesDrawn(): boolean;Whether the water's waves are drawn now: the look has them and the quality allows them