# Sprite sheets and flipbooks

> Aego 0.12.5 · development; docs build `4a32b816933e02930662f6a443cb25abe6050d090c55e237cbff5c44ae9b25f8`. [Build manifest](/docs-build.json).

Select a PNG in Assets to open its inspector: the sheet with its cells.

- **Slice by Grid** cuts cells of one size, after an offset and with padding between them, row by row. **Count** stops after that many.
- **Slice by Alpha** finds every separate shape whose alpha is above the threshold and orders them in rows from the top, each row from the left.
- **Slice** writes the cells into the sheet's `.meta`. Each cell becomes a sprite asset named `assets/hero.png#hero_000` with its own id. Undo puts the previous cells back.

Slicing again with the same number of cells keeps every id, so clips and scenes that use the cells stay intact. Deleting the sheet removes its cells. A sliced sheet cannot be packed into an atlas group.

![The inspector of a sheet: Import settings, the cells and the slicing setup](shots/slicer.png)

The **Import** section above the sheet edits how the PNG is imported: filter (nearest for pixel art, linear for smooth art), sRGB, mipmaps, the atlas group with its padding, and whether the edges are extruded. Changes wait until **Apply**, which rewrites the `.meta` and reimports the texture; **Revert** drops them. Apply is one Undo step, the same kind as slicing, so Undo restores both the settings and the cells in the order you changed them.

In Assets a sliced sheet has an arrow on its tile: it opens the cells right after the sheet, each with its thumbnail. Select cells with Ctrl+click and Shift+click, then **Flipbook from Selection** uses them in name order. Drag a cell onto a `sprite` field in the Inspector or onto a sprite track in the Animation panel. Cells cannot be renamed, moved or deleted on their own: slice the sheet again instead.

To animate the frames, select the node, keep the sheet selected in Assets (or open in the inspector) and pick Create → Animation → **Flipbook from Selection** (Ctrl+Shift+N, `flip`, Enter). The clip shows the cells one after another at 12 frames per second, as step keys on `SpriteRenderer.sprite`. A node whose Animation Player already has a clip gets the frames in that clip; otherwise a new looping clip is created next to the scene with an Animation Player that plays it. The Animation panel shows the frames as thumbnails.
