Textbox is a very common and useful control in applications, reading the input and displaying the symbols in the main area. For multiplayer games, players love to use the control to communicate with each other for exchanging their thoughts. A textbox control can also act like a command line for controlling the game settings. With textbox control and corresponding functions, you can do a lot of things. In this recipe, you will learn how to make your own textbox control in Windows Phone 7.
The following steps will help you to implement a text input control for communicating in your own Windows Phone 7 game:
1. Create a Windows Phone Game project in Visual Studio 2010 named
TextBox
, and changeGame1.cs
toTextBoxGame.cs
. Then, addcursor.png, button.png, backspace.png, TextboxBackground.png
, andgameFont.spriteFont
to the content project.2. Now, let’s develop a button class for input. First of all, in the
Button...