Skip to content
Work in progress. These docs describe Spawnite at launch, and some parts are still being built.

definePixelTexture

definePixelTexture(options): PixelTexture

Declares a texture at module scope: painted on the CPU from a painter and its size, or drawn from image files. A painted texture’s normal map comes from its painter’s height. Nothing paints or loads until a view first uses it, so a room paints nothing. Checks its values here, throwing with its name.

Parameter Type
options PixelImageTextureOptions

PixelTexture

definePixelTexture<Paint>(options): PixelTexture

Declares a texture at module scope: painted on the CPU from a painter and its size, or drawn from image files. A painted texture’s normal map comes from its painter’s height. Nothing paints or loads until a view first uses it, so a room paints nothing. Checks its values here, throwing with its name.

Type Parameter
Paint extends (context) => unknown
Parameter Type
options Omit<PaintedPixelTextureOptions, "paint"> & object

PixelTexture