Jump to content

  • Log In with Google      Sign In   
  • Create Account


Ascii image to texture


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   -  Reputation: 361

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.



Sponsor:

#2 rdragon1   Crossbones+   -  Reputation: 1186

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   -  Reputation: 306

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.



PARTNERS