← back to roto on ba3a.dev

SheetPacker

Lays the frames of animations out on one sheet, row by row, each in a cell of its own size: nothing is trimmed, rotated, padded or extruded, so the ground line and root stay where they were drawn.

Functions

Link copied to clipboard
fun pack(animations: List<SheetAnimation>, maxWidth: Int): PackedSheet

The sheet of animations, as many cells wide as fit in maxWidth pixels, but at least one and no more than there are frames. All frames are of one size and no two animations share a stem. A sheet over 16384 px on either side is refused with an IllegalArgumentException naming its size.