Book Image

Cocos2d Game Development Blueprints

By : Jorge Jordán
Book Image

Cocos2d Game Development Blueprints

By: Jorge Jordán

Overview of this book

Table of Contents (15 chapters)
Cocos2d Game Development Blueprints
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Texture atlases


Texture atlases are a way to combine several images into a bigger one that will contain them, and will improve our game performance.

These files rely on the fact that any texture loaded takes a power of two values as the width and height in the internal memory. For example, let's imagine we have a texture whose dimensions are 150 x 150, and will take 256 x 256 in memory, so you can have an idea of the loss of resources we will face if we load several images like this:

In fact, texture atlases are very similar to sprite sheets, but they differ in two aspects:

  • Texture atlases can contain images that are not to the power of two in the same file, whereas sprite sheets can't

  • Sprite sheets need to load several files, whereas texture atlases just need one to have all the artwork available in your game

But how can we create these texture atlases? There are several tools to create and edit texture atlases such as the AtlasMaker script for Photoshop or NVIDIA Texture Atlas Tools, but one...