SpriteSheet

From Slick2D Wiki
Jump to: navigation, search

Sprite sheets are individual sprites (or images) put together to build one image. This is often done for performance reasons (it's faster to use one image than multiple seperate small ones). Slick provides the SpriteSheet class that lets you access each of the sub-images of the sheet as seperate images easily.

The SpriteSheet class assumed that all the images are evenly spaced. It essentially splits the source image in to an even grid and then allows access to the image in each cell of the grid as a seperate image. These images can then be combined into animations or used as individual sprites/images in game rendering.

While the SpriteSheet class assumes that all the sprites are evenly spaced, the Packed Sprite Sheets uses a descriptor file to allow seconds to be placed a arbitrary location on the image and still be accessed as individual sprites.

See Also[edit]