Expand description
Sprite atlas helpers: frame geometry and frame extraction. Used by the renderers; kept renderer-agnostic so a future GPU renderer reuses them.
Functions§
- extract_
frame - Extracts frame
frame_indexas a tightly packedframe_width * frame_height * 4RGBA8 buffer. - frame_
rect - Returns
(x, y, width, height)of frameframe_indexin the atlas. Frames are laid out row-major:cols = atlas.width / frame_width.