Jump to content

View more

Image of the Day

The night is still, but the invasion brings chaos. #screenshotsaturday #hanako #indiegame #gameart #ue4 #samurai https://t.co/cgILXuokoS
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.


Sign up now

Ascii image to texture

4: Adsense

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 ShadowMan777   Members   

374
Like
0Likes
Like

Posted 29 December 2012 - 03:38 AM

Hello. I want to be able to convert an ascii file into a texture, where the texture is composed of the characters in the ascii file. For instance, if I had a  3x3 ascii file that looked like this.

 

@@@

@@@

@@@

 

I want to be able to generate a texture that is some given size, say 512x512, that has those 9 ascii characters on the texture(with the same rows and columns). I have not been able to think of a good way to do this, and I need to be able to do it dynamically. Any ideas? Thanks.



#2 rdragon1   Members   

1205
Like
0Likes
Like

Posted 29 December 2012 - 03:44 AM

get a font renderer (or write one), and render the text to a texture



#3 PhilObyte   Members   

486
Like
0Likes
Like

Posted 30 December 2012 - 06:11 PM

If you are using XNA you can draw a string with the normal SpriteBatch to a specific RenderTarget and then store it in a Texture2D.

You can even save it as JPG oder PNG with one line.






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.