Saving

Naming Sprites

Each clipped sprite should be given a unique and descriptive name.  The name of each sprite will become the file name if the sprites are saved to a directory.  If the sprites are packed, it will be the label given to the sprite in the definition file.

Sprite info

Sprite info

Saving to a Directory

First select the sprites you want to save in your clipped sprites list.  If you deselect all the clipped sprites, then all will be used by default.  Then click the Save To button (Ctrl+S) and select a directory.  All the clipped sprites will be saved to that directory as individual image files.

Packing a New Sprite Sheet

To pack into a new sprite sheet, follow the same steps above to select the clipped sprites you want to save.  Then select a packing method.  Finally, click the Pack button (Ctrl+P).  Give your new sprite sheet a name and click save.  A new sprite sheet will be generated along with a definition file with a .def extension.  This file describes the name, location, and size of each sprite in the sprite sheet, and follows the same format as the definition file used for Image Packer.

Packing Methods

The packing method specifies the algorithm used to pack the images into a new sprite sheet.  Doing this in an optimal way is actually a very, very hard problem in computer science.  To make the problem tractable, a lot of algorithms have been designed to get “close to” optimal solutions.  The packing method determines how close to optimal the pack is, and how quickly the images can be packed.

  • Grid – Places the sprites in a regular grid, with lots of empty space in most cases.  This formats sprites to be read by frameworks that support reading sprites that are regularly spaced on the sheet.  In addition to the standard .def file, a .grid file will be written describing the grid.

 

Grid pack

Sprites packed with grid method.

 

 

  • Heuristic recursion – Fast and pretty efficient.  This method is based on this paper by Zhang, but modified a little to give better performance for shapes with a low aspect ratio.  The main difference is that the modified version uses sprite height to dictate the insertion order.

Heuristic Recursion Sprite Pack

A sprite sheet packed with heuristic recursion method.