Book Image

Sparrow iOS Game Framework Beginner's Guide

By : Johannes Stein
Book Image

Sparrow iOS Game Framework Beginner's Guide

By: Johannes Stein

Overview of this book

Table of Contents (20 chapters)
Sparrow iOS Game Framework Beginner's Guide
About the Author
About the Reviewers

Working with sprite sheets

So far, we loaded every image on its own and displayed them on the screen. Sprite sheets are a way to combine all of these smaller images into one big image. When we load the image, we are able to use the textures in the same way that we are used to.

When using multiple images, something called a "texture switch" happens every time the current active texture is being swapped out by a different one. This operation is quite heavy on performance, so it should be avoided where possible. Sprite sheets allow us to achieve this by using the same image asset for numerous different images, thus avoiding the texture switch and keeping the number of draw calls to a minimum.

Sprite sheets can also be used for sprite animation, in which a series of images is displayed sequentially one frame after another, which creates the illusion of animation to the human eye—just like a flip book.

A texture atlas is a specialization of sprite sheets with regard to containing smaller images...