Organizing art into texture atlases

We will quickly overrun our project navigator with image files if we add all our textures like we did with our bee. Luckily, Xcode provides several solutions.

Exploring Assets.xcassets

We can store images in an .xcassets file and refer to them easily from our code. Follow these steps to prepare our .xcassets file:

  1. Open Assets.xcassets from your project navigator.
  2. You will see an empty AppIcon entry. You can leave it there for now; we will revisit the AppIcon later.

Collecting art into texture atlases

We will use texture atlases for most of our in-game art. Texture atlases organize assets by collecting related artwork together. They also increase performance by optimizing all of the images inside each atlas as if they ...

Get Swift Game Development - Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.