Skip to content

pack_sprite_sheet

Pack separate frame images into one uniform-cell sprite sheet on a transparent background.

A deterministic file operation: no model runs and no Creative Units are spent. Frames fill
the grid in the order given; every frame is centered at its own scale in a cell of one size,
so frames cut from one sheet or drawn at one scale stay registered. The tool centers: it
does not align ground lines or rescale one frame against another. A frame larger than the
cell is scaled down to fit, never cropped; a smaller one is never enlarged.

When every frame is a game tile (made with `tile_grid`), the frames are aligned on their
anchor instead: each keeps its scale, every frame's anchor (the bottom center of the cell it
stands on) sits at the same point of its cell, `cell_width`/`cell_height` are ignored, and
`frames` lists each frame's rect on the sheet with its cell center, anchor and Unity pivot.
For a tileset an engine imports directly, use `export_tileset` instead. The sheet is saved to the
workspace library and, when the call runs in a session, placed on its board
(`sheet.placed_on_board`).

Parameters

ParameterTypeDefaultDescription
file_idsrequiredstring (uuid)[]—The frames, in reading order (left to right, then top to bottom): workspace file ids.
columnsinteger0–160Cells across. When columns and rows are both 0, lays every frame in one row.
rowsinteger0–160Cells down. 0 derives it from columns and frame count.
cell_widthinteger1–4096—Uniform cell width in pixels. Omit to use the widest frame without scaling smaller frames.
cell_heightinteger1–4096—Uniform cell height in pixels. Omit to use the tallest frame without scaling smaller frames.
paddinginteger0–5120Transparent gutter between cells, in pixels.
namestring0–120 chars—File name for the sheet.
workspace_idrequiredstring (uuid)—The user's workspace id.
session_idstring (uuid)—Session whose board receives the sheet. Omit to only save it to the library.