1681-engine / pixel / DitherVignette
Class: DitherVignette ​
Defined in: src/pixel/DitherVignette.ts:52
A dithered pixel edge round the screen, on the screen layer: a darkened border, or tinted red and beaten with heartbeat while a player is low on health. The texture is made at full strength, off the frame that first needs it (a full-screen dither is a few ms on a phone), and remade only when the window or the zoom changes; show changes how much of it shows.
Constructors ​
Constructor ​
ts
new DitherVignette(stage, options?): DitherVignette;Defined in: src/pixel/DitherVignette.ts:58
Parameters ​
| Parameter | Type |
|---|---|
stage | Stage |
options | DitherVignetteOptions |
Returns ​
DitherVignette
Methods ​
destroy() ​
ts
destroy(): void;Defined in: src/pixel/DitherVignette.ts:103
Returns ​
void
hide() ​
ts
hide(): void;Defined in: src/pixel/DitherVignette.ts:99
Returns ​
void
setColor() ​
ts
setColor(color): void;Defined in: src/pixel/DitherVignette.ts:72
Parameters ​
| Parameter | Type |
|---|---|
color | number |
Returns ​
void
show() ​
ts
show(alpha): void;Defined in: src/pixel/DitherVignette.ts:90
Shows the edge at alpha (0..1); call each frame it shows.
Parameters ​
| Parameter | Type |
|---|---|
alpha | number |
Returns ​
void