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

useSpriteTexture

useSpriteTexture(image, spriteTextureOptions?): Texture<SpriteImage>

A sprite sheet’s or a tile set’s image, for a material’s map: sRGB, no mipmaps, and nearest filtering unless filter says otherwise. A URL loads the file and suspends while it does. A painted definePixelTexture paints on first use from the game’s texture seed, its colour and coverage alone. The texture is shared by every view that names the same image and filter, and disposed when the last of them unmounts, so a change to it changes it for every material. A texture’s v runs up from the image’s bottom row. A view’s hook: a room mounts no view, so it loads and paints nothing.

Parameter Type
image string | PixelTexture
spriteTextureOptions SpriteTextureOptions

Texture<SpriteImage>