Adventure Genre (AVG) game uses the text or dialog to describe game plots. With different branches, you will experience different directions in game underplaying. In most AVG games, text presentation is the key part, if you have ever played one or more of the games, you might have found the text was rendered character-by-character or word-by-word. In this recipe, you will learn how to work with sprite font and how to manipulate the font-related methods to compute the font and properly adjust the character and word positions in real time.
The following steps will lead you to complete text animation effect in Windows Phone 7:
1. Create a Windows Phone Game in Visual Studio 2010 named
AVGText
, changeGame1.cs
toAVGTextGame.cs
, and add the following code to theAVGTextGame
class as field:// SpriteFont object SpriteFont font; // Game text string text = ""; // The text showed on the screen string showedText = ""; // The bound...