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
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

Chapter 10. Questions and Answers: Trivi... > Message Text and Game Button

Message Text and Game Button

Several utility functions are needed in this game to create text fields and buttons. These cut down the amount of code needed quite a bit. We don’t have to repeat the same new TextField, addChild, and x and y settings every time we create a text field.

What createText does is take a series of parameters and make a new TextField. It sets the x, y, width, and TextFormat values to the values passed in as parameters. It also sets some constant parameters, such as multiline and wordWrap, which will be the same for everything created in the game.


  

You are currently reading a PREVIEW of this book.

                                                                                        

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

  

Start a Free Trial