j
jaipkg.dev
packages / library / JaiSpritesheet

JaiSpritesheet

ae7781elibrary

Jai module to bundle individual images together into a texture atlas

No license · updated 10 months ago

JaiSpritesheet

This module lets you automatically build texture atlases from individual image files at compile time. It efficiently packs multiple textures into one or more atlases, reducing draw calls and improving rendering performance.

Atlas generation is powered by the MaxRects bin-packing algorithm, adapted from juj/RectangleBinPack

How to use

Flags

Flag Name Type Default Description
TRIM_ALPHA bool true Removes any fully transparent areas surrounding the input images.
TILING_BUFFER int 4 Adds a buffer around each sprite when packing images. This prevents floating-point sampling errors from showing seams between adjacent sprites by duplicating edge pixels.

Example Project

Credits and Acknowledgements