I decided to take up SDL and started reading tutorials from lazyfoo.net. Its going quite well so far, i just ran into a question after finishing up lesson 6 (Clip Blitting and Sprite Sheets). The tutorial did a good job of explaining how to "clip" and blit a simple sprite sheet, but what do you do when you have a BIG sheet filled with different sized images?
I wanted to try clipping a mario sprite sheet and sort of got lost. I knew none of the dimensions at all, and even if i figured it out, there are different sized images inside the sprite as well. Am i just suppose to figure them all out (x,y,w, and h) and then assign the attributes to my SDL_Rect array?
I planned to write a nice clipping function with a few parameters to do all the dirty work for me, but this kind of threw a wrench into my plans.
EDIT:
This is sort of offtopic, but the next topic in this section will make the topic count "1337" :D!
SDL sprite sheet clipping
Moderator: Coders of Rage
- ismetteren
- Chaos Rift Junior
- Posts: 276
- Joined: Mon Jul 21, 2008 4:13 pm
Re: SDL sprite sheet clipping
I would create a XML file to go along with the image, that would contain information about where the different sprites are placed on the image.