Skip to content

1681-engine / index / PrepainterOptions

Interface: PrepainterOptions<T> ​

Defined in: src/assets/Prepainter.ts:22

Type Parameters ​

Type Parameter
T

Properties ​

canvas? ​

ts
optional canvas?: (painted) => HTMLCanvasElement | null;

Defined in: src/assets/Prepainter.ts:31

Turns painted pixels into a canvas (default a DOM canvas; tests hand in a stand-in).

Parameters ​

ParameterType
paintedPaintedPixels

Returns ​

HTMLCanvasElement | null


id ​

ts
id: (item) => string;

Defined in: src/assets/Prepainter.ts:25

The item's id, unique among items.

Parameters ​

ParameterType
itemT

Returns ​

string


key? ​

ts
optional key?: (id) => string;

Defined in: src/assets/Prepainter.ts:27

The texture key an id's painting is kept under (default the id itself).

Parameters ​

ParameterType
idstring

Returns ​

string


onPainted? ​

ts
optional onPainted?: (id) => void;

Defined in: src/assets/Prepainter.ts:33

Told when a painting landed in the registry.

Parameters ​

ParameterType
idstring

Returns ​

void


painter ​

ts
painter: Painter<T> | null;

Defined in: src/assets/Prepainter.ts:29

Null where nothing can be painted ahead: then everything is painted on arrival, as without a prepainter.


textures ​

ts
textures: PrepainterTextures;

Defined in: src/assets/Prepainter.ts:23

Released under the MIT License.