Hi everyone, I'm new to the website and I just have a quick question. I've made a sprite sheet for the text for a 2D game I'm currently trying to give legs. Here's the image: http://i.imgur.com/eLIhJ.png
It's very basic. Each character on the sheet is 20x20 pixels and what I need is a sort of mechanism to map out the x and y coordinate for the top left hand corner of each character. The way I've structured the rest of the classes involved, I have a text string that I loop through each character of, which determines the square of the image that is rendered. I've considered just making a separate class with 3 fields, namely: character, xPos and yPos. Then for each character in the string that I'm trying to render I loop through the characters and check whether there's a match, then return the xPos and yPos, however I would imagine this to be quite an inefficient solution. Does anyone know a good method for mapping data?
Thanks in advance,