Book Image

Mastering Cocos2d Game Development

By : Alex Ogorek
Book Image

Mastering Cocos2d Game Development

By: Alex Ogorek

Overview of this book

Table of Contents (15 chapters)
Mastering Cocos2d Game Development
About the Author
About the Reviewers

File suffixes versus directories

When Cocos2d and SpriteBuilder became integrated in Cocos2d 3.0, they changed the way textures are read in by Cocos2d. In previous versions, if you wanted to make a game for the iPhone and the iPad, you had to add various suffixes to your file. For example, if your image was named btnPlay.png, you had to create variously sized files in your project, which were named as follows:

  • btnPlay.png

  • btnPlay-hd.png

  • btnPlay-ipad.png

  • btnPlay-ipadhd.png

This methodology of getting your files saved is typically referred to as using file suffixes.

In the newer iteration of Cocos2d with SpriteBuilder, one of the ways you can manage your textures is by dragging a file of the largest possible size (for example, Retina iPad) into SpriteBuilder. When you click on Publish, SpriteBuilder will take care of the file size variations for you. This way of handling files is referred to as using directories.


Here is a warning: if you decide to manually add files to the Published...