Note About This Book: Advanced Lingo For Games was written by Gary Rosenzweig in 2000 for users of Macromedia Director 7. It is presented here for free on an as-is basis, with no updating. Most of the information and code here can be used in the most recent version of Director. The book has been reproduced from the final editing files archived in 2000, and not the final proof galleys. So some minor differences between this version and the printed version my exist. The entire contents of this book are Copyright 2000, Gary Rosenzweig. No part may be reproduced or copied without written permission. The text here is provided for individual use only.
Want to thank me for making this book available for free? Just buy Special Edition Using Macromedia Director MX and we'll call it even!

Advanced Lingo For Games
by Gary Rosenzweig


Chapter 14 Section 5

Putting It All Together

First you need to create a text member to hold the encoded text. Place some sample text in it, a phrase or just some randomly typed letters, so that you can position the member on the Stage.

You should use a monospaced, or fixed width, font for this member, because if you use a variable width font, the phrase will shift around on the screen as the user tries different letters in different places. In the example game, I used an embedded version of Monaco. Another good font to use is Courier or Courier New. Also, set the text member to the default "Adjust To Fit" rather than "Fixed" size. This allows the member to grow larger for a larger phrase.

After you have this member on the Stage and ready to go, duplicate it in the Cast, and then drag this duplicate member to the Stage. You need to position this member so that it appears just over the other one. Set the ink for both members to "Background Transparent" so one can be seen through the other.

You should select the text in this member and change its color to red or something other than black to distinguish it from the text in the other member. Figure 14.3 shows the screen as it should look now.

Figure 14.3
The game screen shown here has two text members placed on top of each other.

The final element is the text cursor. It should be a rectangle about the size of a single letter in your text members. You may have to experiment with sizes until you get it just right. Place that in the Score as well, but in a higher-numbered sprite channel than the other two members.

The text cursor is set to be "reverse" ink in the example movie. If you want to use a different type of cursor, such as an outlining box or an arrow pointing to a character, then you may want to use another ink instead.

To complete the Score setup, just drop the frame behavior onto the frame script channel. Fill in the Parameters dialog box with the sprite locations of the encoded text member and the text cursor. Also, specify the text member that holds the phrases. If you haven't made that yet, you can come back to the Parameters dialog box and set this later.

The text member with the phrases is the only other element needed. If you want to make this a one-phrase cryptogram, just include one line in the text member. Otherwise, include as many as you like.