Creating modal dialogs and using text input

Often, there are moments in the game when you need to display a dialog and require the user to choose an option before continuing. For example, you might want to prompt for the player's name when they achieve a highscore.

Of course, you can just use the pushScene: method and display the whole new scene. However, sometimes, these dialogs are so small and you want them to cover only a small portion of the underlying scene.

Also, sometimes, you don't want to suspend the running scene while showing the dialog. There are tons of other cases when you might want to show a modal dialog without a separate scene.

In this chapter, we are going to create several custom dialogs and use the built-in UIAlertView class. ...

Get Learning iPhone Game Development with Cocos2D 3.0 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.