Skip to content

MapLightSource beta ​

Interface of @v12-engine/client

ts
export interface MapLightSource

A light that stands at a place of the map: a lamp with no model, a glowing rune, the light of a cave's mouth, a campfire's glow. Only drawn (the client's WorldLights): the rules do not see it. MapLight is the map's sunlight

Members ​

angle ​

ts
angle?: number;

How wide a spot's cone is, in radians; 0.8 when left out

color ​

ts
color?: [number, number, number];

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

direction ​

ts
direction?: [number, number, number];

For a spot: which way it shines (down), how wide its cone is in radians (0.8), how its light falls to the cone's edge (2)

flicker ​

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

How much it flickers, 0..1, and how fast (a fire: 0.3)

focus ​

ts
focus?: number;

How its light falls from the cone's middle to its edge; 2 when left out

halo ​

ts
halo?: number;

A glowing ball where it is, in its colour, this wide in cells: the light itself seen, by day too. None when left out

height ​

ts
height?: number;

How high over the ground (1.5 when left out)

id ​

ts
id: number;

Its own, among the map's lights: what the editor and the map's names know it by

intensity ​

ts
intensity?: number;

How bright, about 0..3 (1)

kind ​

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

All around it, or a cone (spot, with direction, angle and focus)

name ​

ts
name?: string;

What it is called: code finds it by it (client.lights, the map's names)

on ​

ts
on?: boolean;

Put out: drawn by nothing until it is put on (false); on when left out

priority ​

ts
priority?: number;

Which are drawn first where not all are: higher first, then the nearest

range ​

ts
range?: number;

How far it reaches, in cells (8)

specular ​

ts
specular?: number;

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

when ​

ts
when?: 'night' | 'always' | {
        from: number;
        to: number;
    };

When it is on: at night (the default), always, or between two hours of the day ({ from: 20, to: 6 })

x ​

ts
x: number;

The light's x position in cells

z ​

ts
z: number;

The light's z position in cells