Game development
Aseprite slice geometry by frame
Query sparse slice keys and translate local center/pivot geometry to canvas coordinates.
Your inputs
Start with an exampleYour result
Example resultHow it works
Choose the last slice key at or before each requested original frame. Before the first key, follow Slice::getByFrame and clamp to that key. Translate each complete key’s local center and pivot by its bounds origin.
Frames 0 and 1 use key 0, whose local pivot (4,5) plus bounds origin (10,20) gives canvas pivot (14,25). Frames 2 and 3 use key 2; its absent center/pivot do not inherit earlier values.
Limits
Native JSON metadata only: up to 5000 slices, 50000 keys/rows, 10000 frame queries, 2 MB of inputs and a 3 MB report. Unicode single-line names retain exact spelling; duplicate names keep source indices. Duplicate key frames reject. Empty keys mean no geometry; zero-size bounds remain explicit. No binary/pixels, interpolation/timing, tag-relative mapping, atlas trim/rotation or project frame-count inference.