O'Reilly logo

Cocos2d-x Game Development Essentials by Gareth Jones, Arutosh Gurung, Frahaan Hussain

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

Chapter 3. Adding Game Menus

This chapter will guide you through the process of creating menus using the menu items provided by Cocos2d-x and implementing them within the previously created scenes to allow navigation, which was implemented in the previous chapter.

The topics that will be covered in this chapter are as follows:

  • Setting up menus
  • Adding menu items
  • Menu alignment

Setting up the menu

So, what are menus? A menu is a technique to display buttons/navigational functionality. Menus consist of menu items, for example, a menu item image that will be used for this game. There are several items that are provided by Cocos2d-x to construct menus. Some of the commonly used items are as follows:

  • The Menu Font item
  • The Menu Sprite item
  • The Menu Label item ...

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