954,510 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

How do I get the .ttf index for a character in a string?

I've got a font as a sprite sheet with individual characters arranged in the exactly same way as a .ttf file.

How can I get the index of the characters from a string so that I can know the index of the source rectangle to use to grab the correct character from the sprite sheet?

For example

string foo = "acb"


If I were to grab the character at index 0 'a', it would return the correct index of the source rectangle to draw an 'a'.

DaveTran
Junior Poster
151 posts since Mar 2010
Reputation Points: 13
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You