Skip to content

SceneryView beta ​

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

ts
export declare class SceneryView

The scenery of a map on this renderer, the client's DoodadView for scenery that stands still: each doodad a copy or merged by chunk, at a level of detail by its distance (see the top of this file)

Members ​

constructor ​

ts
constructor(renderer: Renderer, ground: SceneryGround, options: SceneryOptions);

Constructs a new instance of the SceneryView class

add ​

ts
add(doodad: MapDoodad): void;

Adds a doodad, or changes the one of its id: drawn on its own at once, merged once it has been still a while

all ​

ts
get all(): MapDoodad[];

Every doodad drawn, a new list

batches ​

ts
get batches(): ((doodad: MapDoodad) => boolean | undefined) | undefined;

set batches(decide: ((doodad: MapDoodad) => boolean | undefined) | undefined);

Whether a doodad is merged, in code, over what is said of its model and of it: true it is (as far as it can be), false it is drawn as a copy, nothing as the rest say. Set it again (or recheck) when what it goes by changes

batching ​

ts
get batching(): Readonly<Required<SceneryBatchLook>>;

set batching(look: SceneryBatchLook);

How scenery is merged now: the game's say over the defaults

clipsOf ​

ts
clipsOf(model: string): string[];

The clips a model has, by their names, once one of its doodads has played one: none until then

dispose ​

ts
dispose(): void;

Takes away its batches, its chunks' geometries, its models and its lights

drawnAs ​

ts
drawnAs(id: number): 'chunk' | 'copies' | 'own' | undefined;

How a doodad is drawn now

frame ​

ts
frame(): void;

Once a frame, before the renderer culls: the levels looked at, what fades stepped, the pictures turned, the batches told

groundChanged ​

ts
groundChanged(area?: {
        x: number;
        z: number;
        width: number;
        depth: number;
    }): void;

The ground changed (all of it, or a rectangle of cells): what stands there stands on it again

letGo ​

ts
letGo(id: number): void;

A lifted doodad let go: drawn as the rest again, merged once it has been still a while

levels ​

ts
levels(visit: (thing: {
        x: number;
        y: number;
        z: number;
        reach: number;
    }, level: number, picture: boolean) => void): void;

What is drawn at which level now, for the debug views (detail): each doodad laid out, its foot, how far it reaches, the level its distance picks and whether that is its picture

lift ​

ts
lift(id: number): boolean;

A doodad taken out of its chunk onto a copy of its own for code (an outline round it): never merged until it is let go (letGo). False for one not drawn

load ​

ts
load(model: string, files?: readonly string[]): Promise<void>;

Loads a model's levels' files now, whatever wants them (a cutscene about to show a far city: the client's WorldDetail.load): all its lighter levels' files, or files by their paths, those said to be loaded by code alone (load: 'never') too. Settles once they have loaded (or could not)

madeInPage ​

ts
madeInPage(file: string): number | undefined;

The triangles of a level made in the page (MADE_HERE, where the game says simplify): nothing for one not made

modelOf ​

ts
modelOf(model: string): DrawnModel | null | undefined;

A model as it was read, once it has loaded: its box and its triangles as numbers, which a pick by ray tries (lite/world/picks.ts). Null where its file could not be read; nothing while it is on its way

named ​

ts
named(name: string): MapDoodad | undefined;

The doodad with a name

night ​

ts
get night(): number;

set night(night: number);

How far into the night it is, 0 by day to 1 once the lamps are fully up (the client's nightOf): what a model that glows by the hour glows with (ModelGlow.night)

outline ​

ts
outline(id: number, style: Outline | undefined): void;

Outlines a doodad in a style of the renderer's (renderer.outlines.style), or no longer (undefined): lifted onto a copy of its own while it is (lift), every copy it is drawn with in the view marked as one thing by its id

pictureLight ​

ts
pictureLight: number;

How bright the pictures are lit (the client's WorldDetail.pictureLight)

play ​

ts
play(id: number, clip: string, options?: {
        loop?: boolean;
        speed?: number;
        onEnd?: () => void;
    }): boolean;

Plays a clip of a doodad's model on it (the client's DoodadView.play): over and over (loop, yes when left out), once (onEnd told as it ends, held at its last frame after: a chest opened stays open). It is drawn on a skeleton of its own while it plays and after (a prop of the units' view: no copy of it, no chunk), until settle. False where the model is known not to have the clip, or nothing draws props

playing ​

ts
playing(id: number): string | undefined;

The clip a doodad plays now, by its name

prepare ​

ts
prepare(): Promise<void>;

Behind the loading screen: waits for the models, their levels' files and their pictures, then lays everything out at the level it is seen at from where the camera is, with nothing fading and every chunk merged

props ​

ts
props?: SceneryProps;

What draws a doodad playing a clip on a skeleton of its own (the units' view's props, the world's): none, and no doodad plays one (play is false)

reach ​

ts
reach(doodad: MapDoodad): number;

How far from its middle a doodad reaches on the ground, in cells

recheck ​

ts
recheck(model?: string): void;

What may be merged worked out again (of one model's doodads, or all): what may be is merged (drawn as copies until its chunk is), what may no longer be leaves its chunk for copies

released ​

ts
readonly released: string[];

The levels' files let go of over the budget, in order: for a panel or a test

relevel ​

ts
relevel(): void;

Everything looked at again in the next frame: the levels said changed (options.detail, the quality)

relight ​

ts
relight(): void;

The lights of every doodad worked out again: what the game says of them changed

reload ​

ts
reload(files: readonly string[]): Promise<void>;

Model files changed on disk (hotFiles): a model or a level's file read before read anew (SceneryModels.reload), and every doodad of such a model laid again from it (its copies, its chunk merged again, its picture baked again), the old let go of once they are; a file that does not load leaves what there was (the client's doodads.reload)

remove ​

ts
remove(id: number): void;

Takes the doodad with an id away, its lights and its place in a chunk with it: nothing where there is none

scale ​

ts
get scale(): number;

What every from of a level is multiplied by: the quality's, times the map's or else the game's

seeThrough ​

ts
seeThrough(id: number, share: number, hole?: boolean): void;

How much of a doodad is drawn while it stands in the way of a unit seen through it (lite/units/seeThrough.ts): 1 whole; less, a copy of its own (out of its chunk, as lift takes it) in its model's fading batch, its pixels left out by the share as a level's fade leaves them (levelFadeOut); hole, in front of a unit cut round (cutout), the same with the see-through's holes cut through it (the fading batch's hole variant, where the scenery was given the holes: SceneryOptions.holes). While it is seen through it fades between levels at once

sense ​

ts
sense?: () => SceneryDetailSense;

What the levels go by beside the distance (the client's picker's: the regions the camera is over, the screen): the lite client's client.detail as it has them; the distance alone, the regions none, when left out

set ​

ts
set(doodads: readonly MapDoodad[]): void;

The scenery of a map: what is not in doodads goes, what is new or changed comes

settle ​

ts
settle(id: number): void;

A doodad drawn as the rest again (the client's DoodadView.settle: merged once it has been still a while), but for a clip its model or it declares, which it goes on playing

sizeOf ​

ts
sizeOf(model: string): readonly [number, number, number] | undefined;

A model's size as it was made (across, up, deep), once it has loaded

stats ​

ts
get stats(): SceneryStats;

What it draws now: doodads by how they are drawn and at what level, chunks, batches, models

stop ​

ts
stop(id: number): void;

Stops the clip a doodad plays, where it is: it stays as it stopped, on its own, until settle

version ​

ts
get version(): number;

Counts up whenever the scenery changes: what draws from it (a minimap) knows to draw again