in

This site is all about the amazingly cool stuff you can do with VB.NET.

Heroic Adventure!

The road to XNA Roguelikes is paved with speedbumps.

XNA doesn't support any type of "console" class, but it does support something cool called a SpriteFont. This takes a TrueType font and (basically) renders a spritesheet of the font, in the form of an XNB file.

So if you're looking to do a Roguelike in XNA, you're gold, right? Just use the DrawString method and render the text on screen as sprites?

Nope.

Apparently (as of the XNA 1.0 Refresh) SpriteFonts do not support monospaced fonts. That isn't to say that you can't use a monospaced font in your SpriteFont class, just that it won't actually be rendered as monospace.

You have some alternatives: 1. create your own sprite based font that IS monospaced. 2. use graphics tiles in your Roguelike.

I haven't figured out which one I'll be using (if I actually take HA! that route.)

Comments

No Comments

About admin

Chris Williams is a Technology Evangelist for Magenic. He is the founder of several .NET User Groups on the east coast, and most recently the Twin Cities XNA User Group (www.twincitiesxnausergroup.com) in Minneapolis, MN. He is a VB.NET MVP, rabid blogger and owner of www.ILoveVB.NET. He's also a MCT, MCSD (.NET) Early Adopter, MCAD, freelance game developer, occasional author, tech editor, code camp & user group speaker, vintage arcade game collector and plays a pretty mean guitar in Rock Band.
Copyright 2008 - ILoveVB.NET
Powered by Community Server (Commercial Edition), by Telligent Systems