Skip to content

LightDef beta ​

Interface of @v12-engine/client

ts
export interface LightDef

A light of the scene: a lamp, a torch, a glowing rune. Only drawn: what other players must see is the game's to say through the simulation, and its view to light

Members ​

angle ​

ts
angle?: number;

How wide its cone is, in radians: 0.8 when left out

color ​

ts
color?: Rgb;

Its colour, 0..1 (a warm white when left out)

direction ​

ts
direction?: Rgb;

For a spot: which way it shines (down when left out), and how wide its cone is, in radians (0.8)

flicker ​

ts
flicker?: number | {
        amount: number;
        speed?: number;
    };

How much it flickers, 0..1, and how fast (a torch: 0.25): steady when left out

focus ​

ts
focus?: number;

For a spot: how its light falls off from the middle of the cone to its edge, 0 even to 10 and more tight (2)

halo ​

ts
halo?: number;

A glowing ball where it is, in its colour, this wide in cells: the light seen, not only what it lights (a rune, a will-o'-wisp, a lamp with no model). Brighter and bigger as the light is, flickering with it, glowing past its edges where the scene glows (WorldGlow). None when left out

intensity ​

ts
intensity?: number;

How bright, about 0..3 (1)

kind ​

ts
kind?: 'point' | 'spot';

All around it (point, the default), or a cone (spot)

name ​

ts
name?: string;

What it is called: code finds it by it (WorldLights.named); a map's light has its own

on ​

ts
on?: boolean;

Off, whatever when says: a lamp put out (handle.set({ on: false })). On when left out

priority ​

ts
priority?: number;

Which are drawn first where not all are (quality low, a renderer that cannot draw them together): higher first, then the nearest

range ​

ts
range?: number;

How far it reaches, in cells (8): nothing past it is lit

specular ​

ts
specular?: number;

How much it shines on what is smooth, 0..1, of its colour (0.25)

when ​

ts
when?: LightWhen;

When it is on: at night (the default: it comes up as the sun goes down), always, or as a function says

x ​

ts
x: number;

Where it is, in the world; or, with follow, from that node, in its own units

y ​

ts
y: number;

The light's height in the world

z ​

ts
z: number;

The light's z position in the world