Skip to main content

Module sprites

Module sprites 

Source
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_index as a tightly packed frame_width * frame_height * 4 RGBA8 buffer.
frame_rect
Returns (x, y, width, height) of frame frame_index in the atlas. Frames are laid out row-major: cols = atlas.width / frame_width.