Skip to content

LiteGameClient beta ​

Class of @v12-engine/client

ts
export declare class LiteGameClient

A game shown and played on the renderer of our own: GameClient member for member, put together from the same parts with the world drawn by LiteWorldView. Made by createLiteClient, and handed out under GameClient's type

Members ​

constructor ​

ts
constructor(options: LiteClientOptions);

Constructs a new instance of the LiteGameClient class

abilityTip ​

ts
abilityTip(caster: number, id: string, level: number, extra?: Parameters<typeof abilityTip>[4]): AbilityTip | Node | undefined;

The tooltip of an ability of a caster, worked out from its stats now: at its level, or at level (the next one, to show what a point would do). As the game's view has it (GameView.hud.abilityTip): the tip, or what it built instead. Nothing for a caster that is not known

achievements ​

ts
get achievements(): AchievementTracker | undefined;

The game's achievements followed for the player (GameView.achievements, campaign plan SH3): their profile in this browser, checked as an objective changes and as the game ends. None in a game that gives none

addLayer ​

ts
addLayer(element: HTMLElement, place: {
        over?: 'scene' | 'bars' | 'world';
        under?: 'bars' | 'world' | 'hud';
    }): () => void;

Puts a canvas or an element of the game's own into the page between two layers (layers): over or under the one named, in the game's element. It takes no input unless it asks (pointer-events: auto). Gives back what takes it out

alert ​

ts
alert(id: number): void;

Something of the player's was hit: told, where they are not looking, the way the game's view likes. What the client does for every hit it is told of; call it from code for one the game decides is an attack too (a spell landing near)

alerts ​

ts
get alerts(): ClientTalk['alerts'];

What of the player's is under attack where they are not looking, and the last of it (toLastAlert)

applyAnimation ​

ts
applyAnimation(src: string, file: string, how?: AnimationFileDef | null): Promise<void>;

Lays an animation file (saved from the editor's Animation panel, animations/<name>.anim.glb) on a model at run time, by its file (the client's applyAnimation): a clip of the model from now on, named by the file's path, with bones saying which of the model's bones each of the file's is, its marks and loop on a look that says none, every unit of the model drawn again with it; with null, taken off. Settles when they are

assets ​

ts
readonly assets: Assets;

Where the game's files are found (Assets): under the address the shared folders and the game's own (GameView.files.assets) are, the app's base when left out

attach ​

ts
attach(element: HTMLElement, at: PinAt, options?: PinOptions): Pin;

Keeps an element of the game's own over a unit ({ entity }, gone with it, hidden where the player does not see it) or a place ({ x, z }, hidden in the fog with hideWhenUnseen), as the view moves. It is put in the world's layer (see layers). Gives back the pin: move(at), remove()

attachMinimap ​

ts
attachMinimap(canvas: HTMLCanvasElement): () => void;

Draws the minimap on the given canvas from now on. Returns a function that stops it.

blood ​

ts
get blood(): boolean;

set blood(on: boolean);

Whether units bleed where they are hit and die (GameView.units.blood): kept and read back, the client draws no blood here

boxCandidates ​

ts
boxCandidates(rect: ScreenRect): EntityView[];

The entities in a screen rectangle the player may select, left to the game's input.selection.box when it has one

camera ​

ts
readonly camera: RtsCamera;

The camera the player looks through

candidates ​

ts
readonly candidates: {
        enabled: boolean;
    };

Babylon's choice of the meshes near the view: none on this renderer, which culls by itself (a stand-in, enabled)

capture ​

ts
capture(): Promise<{
        url: string;
        width: number;
        height: number;
    }>;

TODO(lite) A picture of the view drawn anew at a scale: the screen's own picture, whatever the scale asked

cardSize ​

ts
get cardSize(): CardSize;

set cardSize(size: CardSize);

How many columns and rows the command card has (GameView.hud.cardSize): set in code, the card is put together again on it, the client's places that do not fit going to free slots

cellLayers ​

ts
readonly cellLayers: {
        setDetail(amount: number): void;
        set(layer: string, look: LiteLayerFactories | null | undefined): void;
        of(layer: string): readonly unknown[];
        looks(layer: string): readonly unknown[];
        watch(listener: (layer: string) => void): () => void;
        disturb(layer: string, at: Vec2, strength?: number): void;
        readonly drawn: number;
        readonly terrain: Terrain;
    };

The layers of cells (LiteCellLayers, in the world's LayersSlot), as the client's parts read them. A look set in code (set) is the renderer's (GameView.lite.layers' kind), or a foliage of the client's, drawn by the renderer's grass with its look; one made for Babylon's scene otherwise is not drawn, said once

cinematics ​

ts
get cinematics(): CinematicPlayer;

What plays cinematics (CinematicPlayer): the client's own

connection ​

ts
readonly connection: ConnectionController;

The connection to a server, in a game played on one: how it is (state, the same as client.ui.connection()), tried again by itself once it drops, back in the same seat; once it is lost, retry or leave. A game played in the page is always connected. The HUD's part connection draws it

controller ​

ts
readonly controller: PlayerController;

The player's controller: selection, orders and the keys

copied ​

ts
copied(kind: DataKind, id: string): void;

A copy of a definition made while the game runs (the editor's Copy as new, world.redefine with copyOf): drawn, heard and pictured as what it is a copy of, until the game gives it a look of its own

cutInput ​

ts
cutInput(input: CutInput): void;

A key or a click while the player's hands are off, for whatever of the cinematic waits for one

debrisMost ​

ts
get debrisMost(): number;

set debrisMost(most: number);

Pieces of what breaks apart, at most (the setting debris): kept and read back, nothing breaks apart on this renderer yet

debug ​

ts
readonly debug?: LocalSession;

Direct access to the simulation, for the debug tools. Only there when the game runs in the page itself: nothing the player needs may depend on it

debugTools ​

ts
readonly debugTools: LiteDebugTools;

The debug tools (LiteDebugTools): the switches, numbers and lists of the debug panel that are the game's and the screen's, the spawn tool, the effect tool, the routes, and the 📊 window's counters from the frame's phases and renderer.stats()

debugView ​

ts
debugView(): Promise<void>;

TODO(lite) Draws the scene to look into it, a debug view (the client's debugView): said once, nothing changes

decalsAmount ​

ts
get decalsAmount(): number;

set decalsAmount(amount: number);

How much lies on the ground, and how long, from 0 (nothing) to 1 (all the game says): the setting decals

detail ​

ts
readonly detail: WorldDetail;

The levels of detail (client.detail: the client's own WorldDetail, by the renderer's camera): the units' level each, as the game, the map and each look say, by distance, pixels, region and code, the frame's budget of switches, what is selected or hovered at full, frozen, all at full, its counts; its quality the scenery's, the effects' and the bushes' too, relevel the scenery's

dialog ​

ts
get dialog(): DialogQueue;

The dialog said to the player (DialogQueue): a queue of lines with the first showing in the dialog box, the rules' lines (talk, world.dialog.say) and a cinematic's (cut.say, the dialog lane) in one, a cinematic's first while it plays; what was said (history), Enter (next)

dispose ​

ts
dispose(): void;

Takes everything apart, the last made first; the renderer after the world, the session the last. Safe at any moment

disposed ​

ts
get disposed(): boolean;

Whether it was disposed: it draws nothing more, and what it started (a load under way) lets it be

doodads ​

ts
get doodads(): SceneryView;

The scenery of the map (MapDoodad, the world's): drawn from the map, and added to or taken away from in code, for a wall that falls. A stand-in that says so once where the world draws none

endings ​

ts
readonly endings: EndingsController;

Giving up and pausing: canSurrender, surrender; on a server, pausesLeft, canPause, pause, the pause on now (paused) and resume. The pause menu's lines and the HUD's part paused are drawn from it

entitiesInRect ​

ts
entitiesInRect(rect: ScreenRect, filter: (entity: EntityView) => boolean): EntityView[];

The entities in a screen rectangle that pass the filter

entityAt ​

ts
entityAt(x: number, y: number): EntityView | undefined;

The entity under a screen pixel, or undefined

fade ​

ts
fade(opacity: number, seconds?: number): void;

Blacks the screen out (opacity 1) or brings it back (0) over seconds: drawn by the screen's frame, over the view and under the HUD

firstSeen ​

ts
readonly firstSeen: LiteFirstSeen;

What was made the first time on the renderer (its pipelines, the units' models), with what made each, and the frames over the budget with what was made in them (the client's client.firstSeen, LiteFirstSeen)

floats ​

ts
get floats(): FloatsApi;

The floating text (indicators-plan F3): words and numbers put up over the world in code (client.floats.show('Rally!', { on: id })), what each kind of event floats (GameView.hud.floats) changed while the game plays, what is up

fog ​

ts
get fog(): LiteWorldView['fog'];

The fog of war as it is drawn (the world's): what the player sees, and how bright the rest is

foliage ​

ts
foliage(layer: string): FoliageHandle | undefined;

A layer's grass and bushes on this screen (FoliageHandle, the client's): none where it is drawn without them

follow ​

ts
follow(id: number | null, options?: CameraFollow): void;

Keeps the camera on an entity for as long as it is there; null lets it go

followedId ​

ts
get followedId(): number | undefined;

The entity the camera is kept on (follow), if any

following ​

ts
get following(): boolean;

set following(on: boolean);

The camera stays with what is selected

forHud ​

ts
forHud(): HudClient;

The client as a HUD has it (HudClient): what the HUD's parts, and the game's own drawn in them, are given. Its documented part and nothing else (no renderer, no world); the same object each time

fps ​

ts
get fps(): number;

Frames a second, as the last frame went

frame ​

ts
readonly frame: ClientFrame;

The frame of the game: the client's phases by name, run inside the renderer's frame

frameBudget ​

ts
readonly frameBudget: FrameBudget;

The frame's budget for the work done in pieces (client.frameBudget: the client's own FrameBudget): begun with each frame, the layers' grass laid from its foliage work

freeze ​

ts
freeze(): () => void;

Freezes the world on the screen until what it gives back is called: the frame gives what moves no time

frozen ​

ts
get frozen(): boolean;

Whether the world on the screen is frozen now (freeze)

fx ​

ts
get fx(): ClientKit['fx'];

The effects (FxView, the kit's fx): the game's by name (GameView.fx.defs), played at a place or on an entity, changed and stopped as they play (client.fx.play('fire', { on: id })), defined in code (client.fx.define). A stand-in that plays nothing where the client was made without them

fxAmount ​

ts
get fxAmount(): number;

set fxAmount(amount: number);

How many sparks, smoke and weather there are: a part of what the effects say, from 0 to 1 (the setting effects)

ghost ​

ts
ghost(id: number, options?: {
        clip?: string;
        seconds?: number;
        rise?: number;
        color?: [number, number, number];
        alpha?: number;
        fadeAfter?: number;
    }): Promise<void>;

A see-through likeness of a unit (the client's ghost, GhostOptions): its own model, one colour all over (white), playing a clip of its as it rises from where the unit is and fades away; for the screen alone. A prop of the units' (UnitsView.prop) whose look's materials are see-through (blended, alpha), its colour laid whole over it (tint), its share faded (setAlpha), raised each frame, eased out as the client's. Settles once it is gone; at once where the unit is not known, or has no model

glow ​

ts
get glow(): LiteWorldView['glow'];

The glow past the edges of what is emissive (LiteGlow, the world's): its quality the renderer's glow layer's

groundAt ​

ts
groundAt(x: number, y: number): Vec2 | null;

The point of the ground under a screen pixel, or null where it hits no ground

guard ​

ts
readonly guard: ViewGuard;

The parts of the game's view that threw in the frame, and are skipped since (guard.failed)

gust ​

ts
gust(at: Vec2, gust: WindGust): void;

A gust of wind at a place on this screen (WindGust): the grass and bushes there bend to it, then stand again. An explosion's ring blowing outwards as it spreads, or a push one way where it says around (a spell, a wing's beat). What every player who sees the place is to see is the rules' (gust), which comes here

hidden ​

ts
get hidden(): boolean;

Whether the page is out of sight: its tab behind another, its window shut down. The browser draws no frame then, so a game played in this page holds where it is and goes on when it is seen again; one played on a server goes on there, and the client catches up as it is seen again

hideHud ​

ts
hideHud(kept?: readonly HudWidget[]): () => void;

Hides the HUD, the bars and what is pinned to the world until what it returns is called; lines of dialog still show, and so do the parts named (kept: the minimap, the objectives). Hides add up, like locks

hideWorld ​

ts
hideWorld(): void;

TODO(lite) The world put away against black, for a cinematic with no world

hitStop ​

ts
get hitStop(): number;

set hitStop(amount: number);

How long the attacker and the struck pause on a critical strike or a kill (GameView.feel's hitStop), as a part of what the game says: 1 all of it, 0 none. The player's setting hitStop

hoverEveryFrame ​

ts
get hoverEveryFrame(): boolean;

set hoverEveryFrame(on: boolean);

Picks the entity under the pointer again each frame rather than only when it could have changed: the pointer moved, the camera moved, a tick came in. False (the default) keeps the last answer between those

hoverOutline ​

ts
get hoverOutline(): boolean;

set hoverOutline(on: boolean);

Whether what the pointer is over is outlined, as the game's view says it (GameView.units.hover): yes when it says one

hud ​

ts
get hud(): HudApi;

The HUD while the game runs (HudApi): what the top bar says, the HUD's events, its scale and places, the minimap's look and layers, the debug panel, parts hidden and shown again (see HudWidget), and panels added, each taken away again by what add gives back

inCinematic ​

ts
get inCinematic(): boolean;

Whether a cinematic is playing: the player's hands are off

inking ​

ts
get inking(): boolean;

set inking(on: boolean);

Whether units are inked: a line around each model (GameView.units.ink). Not drawn on this renderer yet: said once, read back as set

inputLocked ​

ts
get inputLocked(): boolean;

Whether the player's hands are off (see lockInput)

itemAt ​

ts
itemAt(x: number, y: number): number | undefined;

The id of the thing at a screen pixel, an entity or a doodad; undefined where there is none

keyboardLock ​

ts
get keyboardLock(): KeyboardLock;

The keys the game uses asked of the browser in full screen, so that Esc is the game's (enabled, locked, codes): where the browser has it. See KeyboardLock

keys ​

ts
readonly keys: Actions<GameClientApi>;

What the keys and the pointer's buttons do, by name: the client's actions and the game's (GameView.input.keys.actions), each on the keys it comes with or on the player's own (bindings, bind, reset), kept with the settings. Asked (is, held), told (on), done in code (press); the screen of the keys draws it

layers ​

ts
get layers(): {
        scene: HTMLCanvasElement;
        bars: HTMLCanvasElement;
        world: HTMLElement;
        root: HTMLElement;
    };

The layers of the game, from the bottom in the order they are drawn: scene (the 3D view), bars (the canvas of bars, floating words and rings), world (elements pinned to the world: attach, plates' HTML), then the HUD and what floats over it, which are the game's element (root) children

layout ​

ts
get layout(): HudLayout;

The HUD's layout: every part and panel a section the player moves, scales, folds and locks (Alt+Shift+L), kept for the next game of the same kind. get, set, moveBy, lock, collapse, reset, edit and onChange (see HudLayout)

lights ​

ts
readonly lights: {
        quality: LightsQuality;
        add(def: LightDef): LightHandle;
    };

The lamps: as many as the quality says (renderer.lamps is the world's lights)

limits ​

ts
readonly limits: Limits;

The game's caps (GameView.world.limits), the defaults for what it leaves out: this client's, not the page's

lite ​

ts
readonly lite: Renderer;

What draws on the canvas

loadUnits ​

ts
loadUnits(): Promise<void>;

Loads the models of unit types while the game runs (GameClient's): nothing to do here, the units read their models as they are drawn

lockInput ​

ts
lockInput(): () => void;

Takes the player's hands off until what it returns is called: clicks, keys, the camera's keys, edges and wheel do nothing (Esc still skips a cinematic). For a cinematic, or a tutorial pointing at something. Locks add up: the hands are back once every one is undone

log ​

ts
readonly log: Logger;

The logger the client's own is made under (client.log): the page's, a tool's. The client's shared one when left out

logs ​

ts
readonly logs: LogRing;

The last things said, by the client and, for a game played in the page, by the game itself: for a console to show

lookFrom ​

ts
lookFrom(name: string): boolean;

Looks from a view of the map saved under a name. False when the map has none by that name

looks ​

ts
readonly looks: ClientLooks;

What unit types look like, while the game runs (S20): looks.get(type), and looks.set(type, look) to change one (a hero in another armour, a skin picked in the menu), its units drawn again once its models are loaded

mapDecals ​

ts
get mapDecals(): unknown;

The marks laid on the map's ground (MapEnvironment.decals), where the client has the effects

mapEnvironment ​

ts
get mapEnvironment(): MapEnvironment;

What the map says it looks like now on this screen (MapEnvironment): the map's own, as the rules last left it (world.setEnvironment) or setEnvironment here, with the game's defaults under it

mapFx ​

ts
get mapFx(): MapFxView | undefined;

The effects playing at places of the map (MapEnvironment.fx), where the client has the effects

mapPings ​

ts
get mapPings(): MapPing[];

Spots marked on the minimap, see minimapPing. The minimap takes them away when they are done

maxFps ​

ts
get maxFps(): number;

set maxFps(fps: number);

The most frames a second (renderer.maxFps: a frame in between left out whole, the phases with it); 0, as many as the screen shows

ts
readonly menu: PauseMenu;

The pause menu, which Esc opens: open, close, its screens, its lines (PauseMenu). A game played in this page waits while it is open

minimapPing ​

ts
minimapPing(x: number, z: number, color?: string, seconds?: number): void;

Marks a spot on the minimap for a few seconds (3, or seconds), in a CSS colour: an attack on the base, an objective

on ​

ts
on(event: 'boundsChanged', run: (change: BoundsChanged, client: GameClientApi) => void): () => void;

Hears something while the game runs, what GameView.on declares: one of the game's own events that come to the screen (by its key or id), or boundsChanged, what the view is held in having changed (RtsCamera.lock, free, bounds). Returns what stops it

on ​

ts
on<T>(event: EventKey<T> | string, run: (payload: T, client: GameClientApi) => void): () => void;

One of the game's own events that come to the screen, by its key or id

onDispose ​

ts
onDispose(run: () => void): void;

Runs run when the game is put away, before what was made with it: for what a scene started along with it, like sharing it for watching

onHidden ​

ts
onHidden(listener: (hidden: boolean) => void): () => void;

Calls back each time the page goes out of sight or back (hidden): to open the pause menu, to say so to the others, to quiet the music. GameView.onHidden is the same, declared. Returns what stops it

onMark ​

ts
onMark(id: number, listener: (mark: string, clip: string) => void): () => void;

Tells listener every mark of an entity's clips as it is reached, until what it gives back is called (kit.onMark)

onStop ​

ts
onStop(listener: (stop: ClientStop) => void): () => void;

Calls back when the client stops (see stopped). Returns what stops it

outline ​

ts
outline(target?: unknown, look?: OutlineLook): {
        remove(): void;
        set(look: OutlineLook): void;
    };

Outlines a thing, a unit or building by its id, a doodad ({ doodad }) or an item on the ground ({ item }): a line around its silhouette on the screen, or a glow (OutlineLook), until the handle takes it off (UnitOutlines). A handle that does nothing for anything else, or where the units draw no outlines

pace ​

ts
get pace(): number | undefined;

set pace(value: number | undefined);

How fast the game goes for a player who holds its pace (a game played in this page or its worker; the setting gameSpeed): 1 as the rules have it, 0.25 to 4. Undefined where it is not theirs: a server's game goes at the host's, a replay at its own. While the game is held (the pause menu) it is kept, and put to use as it goes on

peekBars ​

ts
get peekBars(): boolean;

set peekBars(on: boolean);

The bars of everything in view show for as long as this is set: a key is held for it

picture ​

ts
readonly picture: ClientPicture;

What the picture's finish takes of the quality (the map's look itself is the world's: LiteWorldView.picture), a cinematic's say over it and the look beneath (cinematic, beneath: the world's picture's), and a game's own passes over it (addPass, passes: WGSL on the renderer's chain, lite/world/picturePasses.ts)

ping ​

ts
ping(x: number, z: number, color?: readonly [number, number, number]): void;

Marks a spot of the world, as an order does: a ring on the ground for a moment

pings ​

ts
readonly pings: PlayerPings;

The player's pings (indicators-plan P1): the kinds there are (GameView.pings.kinds), changed while the game plays, and one sent as the player (send(kind, point)) with its audience and cooldown

pingWheel ​

ts
readonly pingWheel: PingWheel;

The wheel of pings (indicators-plan P2): opened at a spot of the view, aimed, sent or put away; its state a signal what draws it follows, its look the game's (GameView.pings.wheel)

pins ​

ts
readonly pins: WorldPins;

Elements of the page pinned to the world, over units and spots of the map: see WorldPins

play ​

ts
play(cinematic: Cinematic | CinematicDef | string, options?: PlayOptions): Promise<boolean>;

Plays a cinematic to its end, skipped or not: whether it played to the end (GameClient.play)

playClip ​

ts
playClip(id: number, clip: string, options?: ClipOptions): boolean;

Plays a clip on an entity's model (the units' view's, UnitsView.playClip): whether it was found and played

pointer ​

ts
get pointer(): {
        x: number;
        y: number;
    } | null;

set pointer(at: {
        x: number;
        y: number;
    } | null);

Last known cursor position over the view, in CSS pixels

pointerLock ​

ts
get pointerLock(): PointerLock;

The pointer kept in the game, so that it scrolls the view at the screen's edges and does not leave it: when (keep, which the setting keepPointer sets), whether it is now (locked), lock and release in code, where it is (at). The pause menu gives it back; losing it otherwise (Esc) opens the menu. See PointerLock

portraits ​

ts
get portraits(): Portraits;

The portraits (lite/previews: the client's Portraits on a stage of side views, the units' models with their skeletons and clips or a type's parts): made the first time one is asked for

preload ​

ts
preload(what?: PreloadWhat, progress?: (progress: PreloadProgress) => void): Promise<void>;

Loads files ahead, for a loading screen: with no what, the models of the unit types the game starts with (the rest behind it once it has started, modelsBehind; every type but the late ones with files.preload: 'all'), the sounds of what it starts with and the ground's textures; with what, the models, sounds and pictures named. A unit type's models are its look's on the renderer (lite.visuals: its own, its other looks', its simpler one), read by the units (UnitsView.prepare); a game whose units are parts has none to load

prepare ​

ts
prepare(seconds?: number, options?: PrepareOptions): Promise<void>;

Gets the first frames ready behind the loading screen, before start: the ground's textures, the scenery's models, their levels and pictures (LiteWorldView.prepare), then frames drawn with the game held until the card has made ready every pipeline of what they draw (renderer.ready(): the renderer makes a pipeline off the frame and leaves a draw out until it is there). A frame may bring in what the one before could not (a chunk merged, a level's file), so it is asked again until a round of frames adds nothing to wait for. At most seconds. Beside those frames, the warm-up's pieces as the scene, the map and the game say (GameView.world.warm, resolveWarm: the units' models up close, the effects asked, the transitions; lite/client/warm.ts), the effects held for those frames to draw

project ​

ts
project(x: number, y: number, z: number): {
        x: number;
        y: number;
    } | null;

The screen pixel a world position is at, or null where it is off the screen

quality ​

ts
readonly quality: Quality;

How much drawing the game asks of the device: its knobs as they are (get), a preset or some knobs set (set), the preset set (preset), the device and the preset guessed for it (device, suggested), and whether the game keeps missing its frame budget (slow, onSlow). The knobs are settings, kept with the others. See Quality

raceLook ​

ts
get raceLook(): RaceLook | undefined;

The look of the race the player plays (GameView.races, campaign plan RC5): the race the session says, or nothing in a game without races or before a random one is settled

recallView ​

ts
recallView(number: number): boolean;

Takes the view back to where it was saved under a number (camera.recall.N). False when none was

recorder ​

ts
recorder?: ReplayRecorder;

The recording of this game, where it is played in the page and recorded (runGame with replays sets it): what a crash report's replay is

releaseClip ​

ts
releaseClip(id: number): void;

Lets go of a clip an entity plays over and over (stopClip stops one played once too)

renderer ​

ts
readonly renderer: {
        heightOf(id: number): number;
        spanOf(id: number): {
            bottom: number;
            top: number;
        };
        kit: ClientKit;
    };

The entities' renderer as the client's parts read it: how high a thing is drawn, the eases, a ring on the ground, the timers, the effects (kit.fx), the line around what the pointer is over (kit.hover: UnitOutlines). TODO(lite): clips, the rest of the kit

renderScale ​

ts
get renderScale(): number;

set renderScale(scale: number);

The picture drawn at a part of the screen's pixels (PictureSettings.renderScale: the chain made again at that share)

report ​

ts
report(kind: CrashKind, message: string, context?: {
        error?: unknown;
        where?: string;
    }): import("../../client/crash").CrashReport;

A report of what happened to this game now, with the last things said: for onCrash. For a game played in the page, the world as it stands (where it can still be saved) and its replay so far (where it was recorded), RV79

resizeSoon ​

ts
resizeSoon(): void;

Fits the view to its canvas at the start of the next frame, just before it is drawn: a resize between a frame and the page being painted would show a cleared canvas for a moment

rest ​

ts
rest(): void;

Puts the game to sleep, its picture and its sounds, for as long as nothing shows it (wake): what plays behind a menu, while the player is on a menu without it. The renderer draws no frame meanwhile

root ​

ts
readonly root: HTMLElement;

The game's element on the page, with the canvas and the HUD in it: its theme is put on it, and keys pressed with the focus elsewhere of the page are not the game's. The canvas's parent when left out

runAction ​

ts
runAction(id: string): void;

Presses one of the game's own buttons, see GameView.hud.actions

runtime ​

ts
readonly runtime: ClientRuntime;

What the app runs with (ClientRuntime): where it keeps things in the browser. The page's when left out

saves ​

ts
readonly saves?: SavesController;

Saving and loading where the game is played (SaveControls): the client's saves are made of it (client.saves). None without

saveView ​

ts
saveView(number: number): void;

Saves where the view is under a number (camera.save.N), to come back to (recallView)

sceneShadows ​

ts
get sceneShadows(): LiteWorldView['sceneShadows'];

Which things cast the sun's shadow (LiteSceneShadows, the world's: the game's say, the map's, the game's code thing by thing)

score ​

ts
readonly score: ClientScore;

The score as this screen is told it (RuleSettings.score): the numbers and the timeline (state, line, signals), read by player, team and type, written as the game wants (format, GameView.hud.score), heard of (on); and the score screen (the HUD's part score) opened and closed (show, hide)

screenPass ​

ts
get screenPass(): LiteScreenPass;

The screen's frame over the picture (LiteScreenPass): the bars, a fade, what a cinematic puts on it

seeThrough ​

ts
get seeThrough(): LiteWorldView['seeThrough'];

What is seen through where it hides units (SeeThrough, the world's: the game's look, the map's over it)

selectionBox ​

ts
get selectionBox(): ScreenRect | null;

set selectionBox(box: ScreenRect | null);

The rectangle the player is dragging out over the view, in screen pixels; null when there is none

session ​

ts
readonly session: GameSession;

The player's seat in the game. Everything the client knows and does goes through it

setDialogLook ​

ts
setDialogLook(look: Partial<DialogLook> | null): void;

Changes how the dialog box looks while the game runs, over what it is (GameView.cinematics.dialog): subtitles a player turned on in the game's settings, a faster typewriter. null for the view's look again

setEnvironment ​

ts
setEnvironment(change: Partial<MapEnvironment>, options?: {
        over?: number;
    }): void;

Changes what the map looks like on this screen alone, field by field over what it is: a flash of red sky as the player's hero falls. What every player is to see is the rules' (world.setEnvironment). over: seconds to ease into it over, from what is drawn

setFog ​

ts
setFog(brightness: Partial<FogBrightness>): void;

How bright the fog of war is drawn from now on: what is not said is the rules'

setLighting ​

ts
setLighting(lighting: Lighting | null | undefined): void;

The light of the scene from now on, over the day's (see Lighting); null for the view's own again

settings ​

ts
readonly settings: Settings;

What the player sets, kept for the next games: read and set by id (get, set, reset), told of as they change (onChange). The client's own and the game's (GameView.hud.settings); the pause menu's settings show them

showAllBars ​

ts
get showAllBars(): boolean;

set showAllBars(on: boolean);

The bars of everything in view show: the debug panel's switch

sideMarks ​

ts
get sideMarks(): boolean;

set sideMarks(on: boolean);

Whether a mark by side (yours, an ally's, an enemy's) is drawn under every unit and on the minimap: the setting sideMarks

skipCinematic ​

ts
skipCinematic(): void;

Skips the cinematic playing, when it may be

skipLine ​

ts
skipLine(): void;

Enter, or a click on the dialog box: moves on from the line the player hears (DialogQueue.next)

snapshotPicture ​

ts
snapshotPicture(width: number): Promise<string | undefined>;

A picture of the game as it is drawn now, width pixels wide, as a JPEG data URL: the frame as the renderer finishes it

sounds ​

ts
get sounds(): SoundPlayer;

What the game is heard through

speed ​

ts
get speed(): number;

set speed(value: number);

How fast the game goes, 0 paused: as the simulation says. Set with a debug command, where the player may

start ​

ts
start(): void;

Draws the game, a frame at a time, until it is disposed or stops (stopped)

state ​

ts
readonly state: GameState;

The game as far as this player knows it

stopClip ​

ts
stopClip(id: number): boolean;

Stops the clip an entity plays on demand, where it is: whether there was one to stop

stopped ​

ts
get stopped(): ClientStop | null;

Why the client stopped drawing the game, once it has: a frame that threw, the graphics device lost, the rules that threw (GameSession.failure). Null while it plays. A GameMount shows it on its error screen

takeFile ​

ts
takeFile(): void;

A file of the game's as the editor lays it now (relayFile): not taken on this renderer yet, said once

takeHud ​

ts
takeHud(view: Pick<GameView, 'units'>): void;

The HUD over units as a view says now (unitHud, and each type's UnitLook.unitHud): what the editor's Unit HUD panel writes into hud.json, drawn at once in the game played there

takeRules ​

ts
takeRules(game: Rules): void;

Takes a new version of the game's rules while it runs (hot reload, hotRules): into the world, when it runs in the page; a world in a worker is asked to load it again itself (serveWorld reload). A world elsewhere (a server) is not reached: a new game takes it

takeView ​

ts
takeView(next: GameView): void;

A new version of the game's view (hot reload): its words and pictures. TODO(lite): its looks drawn again, its effects, its cinematics

team ​

ts
get team(): number;

The player's team, as the last snapshot says: the rules may move them to another

teamColors ​

ts
get teamColors(): TeamColors;

set teamColors(colors: TeamColors);

The players' colours (the setting teamColors): as the game says (game), a set anyone tells apart (distinct), by side (sides: you, allies, enemies), or a function of the game's own. Every unit is drawn again in them

theme ​

ts
readonly theme: ThemeControl;

The look of the interface while the game runs (see GameView.hud.theme): get what it is, set a theme by name or values over it, reset to the game's, and onChange to hear of it. Taken off the page when the game ends

timers ​

ts
get timers(): ViewTimers;

Timers of the screen: what fades, flashes or moves on it. Cleared when the game is disposed (see ViewTimers)

toLastAlert ​

ts
toLastAlert(): boolean;

Takes the view to where the last alert was. Whether there was one

transitionPass ​

ts
get transitionPass(): LiteTransitionPass;

The transitions between a cinematic's shots (LiteTransitionPass)

transitions ​

ts
get transitions(): TransitionRegistry;

The transitions a cinematic may name: the client's own, and the game's that are written in WGSL

ui ​

ts
readonly ui: Ui;

The UI the HUD is drawn with

unitHud ​

ts
get unitHud(): UnitHudApi;

The HUD over units while the game runs (indicators-plan U2, see UnitHudDef): one set for a unit (null for none, undefined to take it back), one set for a unit type over its UnitLook's, what a unit has and which plate it shows now, and the defaults of every def (look, changed in place: client.unitHud.look.within = 60)

view ​

ts
readonly view: GameView;

How the game looks and sounds: the client side of the game module

viewCorners ​

ts
viewCorners(): Vec2[];

The four corners of the view on the ground as map points

viewNamed ​

ts
viewNamed(name: string): CameraPose | undefined;

A view of the map saved under a name in the editor (MapCamera), as the camera takes it

wake ​

ts
wake(): void;

Wakes a game put to sleep (rest), where it was

warm ​

ts
warm(what?: WarmWhat, options?: WarmOptions): Promise<WarmResult>;

Makes ahead what would be made the first time it is drawn (client.warm, the client's): the units' models up close, effects, the transitions (lite/client/warm.ts). Resolves with what it did and skipped

warmed ​

ts
get warmed(): WarmResult | undefined;

What the warm-up behind the loading screen did (prepare, GameView.world.warm): undefined before it, or where it was off

waterfalls ​

ts
get waterfalls(): {
        readonly list: readonly unknown[];
    };

TODO(lite) The waterfalls as they are drawn (the client's waterfalls): a stand-in with none listed, said once

wind ​

ts
get wind(): WindNow;

The wind as it blows this moment (MapWind, its gusts worked in): what the grass and the weather move with, for a game's own effects to move with too

words ​

ts
readonly words: Words;

What the client says things in (campaign plan LO1): the language the player chose of the game's (GameView.languages, the setting language), and the words of a key, a message or a name in it. Signals

world ​

ts
readonly world: LiteWorldView;

The world as it is drawn (LiteWorldView)