Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint

Using text

In the previous chapter you learned how to load, display, and position images. In most games, however, you'll combine images with text. And the text will usually change depending on how the game changes. The first thing you're going to look at in this chapter is how to make and use interactive text using TextField and TextFormat objects.

Setting up the project

I'm going to start you with a basic program that sets up two text fields on the stage and displays a trace message that says “Game started”. You won't understand much of this new code, but I'll explain all of it in the pages ahead. If you don't feel like typing all this out, you'll find this setup file in the chapter's source files in a project folder called NumberGuessingGameSetup.


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free 10-Day Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint