I'm generally a big fan of having as few text fields in an application as possible, and this holds doubly true for a game but there are some occasions when receiving some sort of textual information from the player is required so in these regrettable occasions, a textbox or field may be an appropriate choice.
Unfortunately, a premade textbox isn't always available to us on any given gaming project, so sometimes we must create our own.
This recipe only relies upon the presence of a single
SpriteFont file referring to any font at any desired size.
To start adding textboxes to your own games:
SpriteFontto the solution named
<?xml version="1.0" encoding="utf-8"?> <XnaContent xmlns:Graphics= ...