Skip to main content

Module atlas

Module atlas 

Source
Expand description

Sprite-sheet atlases: frame metadata from a JSON sidecar plus the UV math the sprite pipeline needs.

The frame table lives here because the renderer owns UVs and batches by texture key — one sheet means one texture, so every frame of it lands in the same draw call. pite-assets reuses parse_atlas to validate the same files for check.

Structs§

Atlas
A parsed sheet: its texture file plus named frames.
AtlasFrame
One frame inside the sheet, in pixels.

Constants§

SIDECAR_EXT
Sidecar suffix appended to a sheet’s file stem.

Functions§

load_atlas
parse_atlas
Parse atlas JSON. Empty sheets, zero sizes, and frames outside the sheet are errors — a bad atlas must never reach the GPU as silent garbage.
sheet_for_sidecar
The sheet a sidecar describes: sheet.atlas.json -> sheet.png.
sidecar_for
Sidecar path for a sheet: sheet.png -> sheet.atlas.json beside it.