World light
Describe illumination in world cells.
Generated from the reviewed SDK 0.1.0 contract snapshot. Unreviewed workspace changes are not included.
Public exports
Import from @scape/sdk.
GizmoLight, GizmoLightColor, GizmoLightPattern, gizmoLightError.
Type declarations
These declarations preserve source comments and related types. Import only the public exports listed above; module-relative paths below describe how the package is organized.
ts
/** Hex sRGB or explicit sRGB components from 0 to 1. */
export type GizmoLightColor = string | [number, number, number];
/** A rotating, warped field of seeded spots over a two-color wash. */
export interface GizmoLightPattern {
kind: 'scattered';
/** Position coefficients in scene pixels; the fractional sum seeds the pattern. */
phase: [number, number];
rotation: {
speed: number;
variation: number;
phase: number;
};
density: number;
warp: {
frequency: [number, number];
phase: [number, number];
amount: number;
};
jitter: number;
palette: GizmoLightColor[];
spots: {
/** Minimum/maximum radius in pattern-cell units. */
size: [number, number];
aspect: [number, number];
edge: number;
gain: [number, number];
halo: {
radius: [number, number];
gain: number;
};
fade: {
speed: [number, number];
thresholds: [number, number];
};
};
/** Uses light.color/innerColor across the rotated horizontal axis. */
wash: {
gain: number;
falloff: number;
blend: [number, number];
};
}
/** Shared world-space light, not a sprite halo. Motion is bounded data, never a shader upload. */
export interface GizmoLight {
/** Radius in grid cells (.25–12), independent of sprite size. */
radiusCells: number;
/** sRGB colors, mixed from the edge toward the center. */
color: GizmoLightColor;
innerColor?: GizmoLightColor;
/** Additive overlay strength (0–1); basement defaults to the surface value. */
intensity: number;
basementIntensity?: number;
/** Contribution to the shared basement darkness reduction (0–1). */
illumination: number;
falloff?: {
start: number;
edge: number;
power: number;
};
/** Optional spatial pattern; radial lights remain the default. */
pattern?: GizmoLightPattern;
/** Continuous value noise. Reduced motion evaluates this recipe at time zero. */
motion?: {
/** Seed coefficients applied to scene pixel coordinates. */
phase: [number, number];
bias: number;
bands: [speed: number, amount: number, offset: number][];
flare?: [speed: number, low: number, high: number, amount: number, offset: number];
drift?: {
speed: [number, number];
phase: [number, number];
amount: number;
};
stretch?: {
speed: [number, number];
phase: [number, number];
amount: number;
};
edge?: {
scale: number;
drift: number;
amount: number;
};
radius?: [base: number, flicker: number];
};
}
export declare function gizmoLightError(value: unknown): string | null;1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
Usage and limits
See Gizmo guides, working examples, and limits for lifecycle, validation and host behavior.
