XNA 3.0 TextHandler Class
I noted in my entry earlier today that a new tutorial was in the works, and I had some time this evening to do the formatting, so it is up faster than I had expected! :)
 
This code comes from a project I have been working on, for which I decided that I needed a simpler way to handle text output, and especially needed a way to change the font/color of text being output at arbitrary points in the string without using a bunch of different calls to SpriteBatch.Draw().  This tutorial walks through building a C# static class to automate some of the work in drawing text to the screen in XNA, and includes a couple of nifty features like rudimentary formatting codes, a "console"-type printing mode, word wrapping, and automatic font loading.
 
You can find the link on the Tutorials page, or jump there directly
 
This class should work on Windows, the XBox 360, and the Zune without changes, and is really just the basics of what this class could be expanded to do.
Reader Comments
You know that your code in the tutorial is white on white, thus invisible? Otherwise cool tutorial.
Posted: 8/11/2009 12:40:59 PM | By: drozzy | Rating:
Excelent tutorial! =)=)=)=)=)=)
Posted: 8/24/2009 4:13:29 PM | By: rcng | Rating:
Drozzy : That's odd... I've looked in both IE and Chrome and everything appears normal (ie, color-coded text on white).
Posted: 8/26/2009 6:47:07 AM | By: Kurt Jaegers | Rating:
Great tutorial, great work. I am using your class in my application (modifying a bit). Keep it up :)
Posted: 12/21/2009 6:40:04 AM | By: Mylo | Rating:
allright nice information
Posted: 1/24/2010 8:44:27 AM | By: nanang | Rating:
Add Your Comments
Your Name (required):

Your Email Address (required, is not shown to the public):

Your Website Address (optional):

Remember this information for future comments?
YES NO
Your Comments:


































 

 
 
Site Contents Copyright © 2006 Full Revolution, Inc. All rights reserved.
This site is in no way affiliated with Microsoft or any other company.
All logos and trademarks are copyright their respective companies.
RSS FEED