O'Reilly logo

Cocos2D Game Development Essentials by Ben Trengrove

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

Accepting user input with form elements

There are many other user input methods that are not buttons. Cocos2d v3 brings a whole suite of form components that were missing from previous versions.

It is also possible to include UIKit components, but in nearly all cases, a better user experience will be provided by using the Cocos2d equivalent.

The form elements available are as follows:

  • CCButton
  • CCTextField
  • CCLabelTTF, CCLabelBMFont
  • CCSlider
  • CCScrollView
  • CCTableView

To use these elements, you must provide images for their appearance. However, there is an easier method. SpriteBuilder comes with template versions of the form components and makes their use very simple.

These are what each component looks like in an app.

  1. Start a new SpriteBuilder project.
  2. Drag ...

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