Jump to content
  • Advertisement
Sign in to follow this  
Jos

ASCII game in XNA?

This topic is 1963 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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
Advertisement

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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!