O'Reilly logo

Cocos2d-x Cookbook by Akihiro Matsuura

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Creating menus

In this recipe, we will create a menu. A menu has various buttons such as a start button and a pause button. A Menu is a very important component for any game and they are really useful too. The steps to use a menu are little complex. In this recipe, we will have a glance over creating menus to understand its complexity and to get used to them.

Getting ready

We prepared the following image as a button image and added them to the Resources/res folder in our project. We will use the following image of the button to use it as menu:

Getting ready

How to do it...

Firstly, we will create a simple menu that has one item for a button. We will use the item1.png ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required