Book Image

Cocos2d-x by Example: Beginner's Guide

By : Roger Engelbert
Book Image

Cocos2d-x by Example: Beginner's Guide

By: Roger Engelbert

Overview of this book

Table of Contents (19 chapters)
Cocos2d-x by Example Beginner's Guide Second Edition
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Adding a menu to our game


Right now, we only see the game logo on our introduction screen. We need to add buttons to start the game and also for the option to play a tutorial.

In order to do that, we'll use a special kind of Layer class, called Menu.

Menu is a collection of MenuItems. The layer is responsible for distributing its items as well as tracking touch events on all items. Items can be sprites, labels, images, and so on.