Skip to content

LiteRenderKit beta ​

Interface of @v12-engine/client

ts
export interface LiteRenderKit

What a game's own renderer is made with

Members ​

draw ​

ts
readonly draw: KitDraw;

Shapes at places, in colours

drawn ​

ts
drawn(id: number): {
        x: number;
        y: number;
        z: number;
        visible: boolean;
    } | undefined;

Where an entity is drawn now, between two ticks; nothing for one that is not

eases ​

ts
readonly eases: EaseRegistry;

The easing curves by name, the client's and the game's

fx ​

ts
readonly fx?: KitFx;

The effects, where the world plays any

lamps ​

ts
readonly lamps: KitLamps;

The lights besides the sun and the sky

log ​

ts
readonly log: Logger;

Where a renderer of the game's says what went wrong

optional ​

ts
optional<T>(service: Service<T>): T | undefined;

What provides a service, or nothing

provide ​

ts
provide<T>(service: Service<T>, made: T): void;

Gives a service by its name (service<RoadsApi>('roads')), for the other renderers and the game to ask for: once (services.ts; the client's RenderKit.provide)

require ​

ts
require<T>(service: Service<T>): T;

What provides a service: thrown, naming it, where no renderer does (the client's own: units, marks)

ring ​

ts
ring(x: number, z: number, colour: KitRgb, from: number, to: number): void;

A ring on the ground that grows from one radius to another and fades, then goes

rings ​

ts
readonly rings: KitRings;

The ground's circles, by name

root ​

ts
readonly root: HTMLElement;

The element the game is on: what a renderer puts on the page goes in it

state ​

ts
readonly state: GameState;

What the player knows of the game: the entities drawn

terrain ​

ts
readonly terrain: Terrain;

The ground: heights, the water's

timers ​

ts
readonly timers: ViewTimers;

Timers on the view's clock: what waits or eases over frames

visualOf ​

ts
visualOf(entity: EntityView): {
        height?: number;
    } | undefined;

What an entity's type looks like, as far as a renderer of the game's reads it: how tall it stands