Sign in to follow this  
Jos

ASCII game in XNA?

Recommended Posts

I want to make a little game in XNA like Dwarf Fortress but I don't know anything about how to draw ASCII graphics, should I use array and text import file, or it's better make ASCII with a drawing software and use png file in XNA?.

 

Share this post


Link to post
Share on other sites

Hey there Endzon,

 

You can draw glyphs in XNA by creating a SpriteFont (right click your content project -> Add New Item -> Sprite Font) and then rendering it with SpriteBatch's DrawString method. Note that you may need to adjust the CharacterRegions in the resulting xml file in order to get all the ASCII characters you want. In terms of structure, you could probably structure the level like a tilemap, where each tile is a string instead of an image. It's then just a matter of looping over the tiles and rendering them with DrawString.

Edited by Racoonacoon

Share this post


Link to post
Share on other sites

Hey there Endzon,

 

You can draw glyphs in XNA by creating a SpriteFont (right click your content project -> Add New Item -> Sprite Font) and then rendering it with SpriteBatch's DrawString method. Note that you may need to adjust the CharacterRegions in the resulting xml file in order to get all the ASCII characters you want. In terms of structure, you could probably structure the level like a tilemap, where each tile is a string instead of an image. It's then just a matter of looping over the tiles and rendering them with DrawString.

 

Thanks, I will practise with that technique and I discovered a usefull program for paint in ASCII: https://code.google.com/p/ascii-paint/

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this