Jump to content

  • Log In with Google      Sign In   
  • Create Account

ASCII game in XNA?


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
2 replies to this topic

#1 Endzon   Members   -  Reputation: 150

Like
0Likes
Like

Posted 04 May 2013 - 11:08 AM

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?.

 



Sponsor:

#2 Racoonacoon   Members   -  Reputation: 443

Like
0Likes
Like

Posted 04 May 2013 - 03:11 PM

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, 04 May 2013 - 03:12 PM.


#3 Endzon   Members   -  Reputation: 150

Like
0Likes
Like

Posted 05 May 2013 - 06:00 AM

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/






Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS