Skip to content

1681-engine / index / AfterimagesOptions

Interface: AfterimagesOptions ​

Defined in: src/fx/Afterimages.ts:6

Properties ​

alpha? ​

ts
optional alpha?: number;

Defined in: src/fx/Afterimages.ts:10

Opacity a copy starts at (default 0.6).


blend? ​

ts
optional blend?: BLEND_MODES;

Defined in: src/fx/Afterimages.ts:18

How copies blend (default 'add': light; 'normal' for painted shadows).


durationMs? ​

ts
optional durationMs?: number;

Defined in: src/fx/Afterimages.ts:12

How long a copy takes to fade out, ms (default 260).


endScale? ​

ts
optional endScale?: number;

Defined in: src/fx/Afterimages.ts:16

The scale a copy shrinks to as it fades, a share of the body's (default 0.85; 1 keeps it).


slots? ​

ts
optional slots?: number;

Defined in: src/fx/Afterimages.ts:23

Copies of a live body (one repainted every frame) are kept in a ring of this many textures, reused, and spent copies are pooled up to this many (default 16: at 22 ms apart and 260 ms each, never all in use at once).


spacingMs? ​

ts
optional spacingMs?: number;

Defined in: src/fx/Afterimages.ts:14

The least time between two copies, ms (default 22: a copy every frame or so at 60 fps without doubling up).


tints? ​

ts
optional tints?: readonly number[];

Defined in: src/fx/Afterimages.ts:8

Colours the copies wear, cycled one per copy (default white): a trail shimmering from white to blue, say.

Released under the MIT License.