Book Image

Learning iOS 8 Game Development Using Swift

By : Siddharth Shekar
Book Image

Learning iOS 8 Game Development Using Swift

By: Siddharth Shekar

Overview of this book

<p>Game development has been simplified with Apple's new programming language—Swift. If you're looking to start learning iOS development then you'll get everything you need - from&nbsp;the absolute basics such as the Xcode interface and takes you all the way to Swift programming.</p> <p>You will take a walk through the creation of 2D and 3D games followed by an introduction to SpriteKit and SceneKit. The book also looks at how game objects are placed in 3D scenes, how to use the graphics pipeline, and how objects are displayed on mobile screens. You will also delve into essential game concepts such as collision detection, animation, particle systems, and scene transitions. Finally, you will learn how to publish and distribute games to the iTunes store.</p>
Table of Contents (18 chapters)
Learning iOS 8 Game Development Using Swift
Credits
About the Author
Acknowledgments
About the Reviewers
www.PacktPub.com
Preface
Index

Chapter 9. Metal

Before we start creating a game, you should understand how to display things on the screen. This is always taken for granted, as all frameworks have a class called sprite, in which we just give a .png or .jpg file and say addChild and tada; we then have an image appearing on the screen. Moreover, with just a few simple functions such as move, scale, and rotate, we can even transform the sprite's position, size, and rotation. In reality, this sprite class does a whole lot of work just to display the image on the screen.

In this chapter, we will look at Metal—a new graphics library from the people at Apple. This graphics library will help us to display objects on the screen. It is a communication tool that talks to the processor, the memory, the graphics processing unit (GPU), and the screen.

If you are coming from a DirectX or OpenGL background, you will see that the process to display stuff on the screen, otherwise known as a graphics pipeline, is very similar to that in...