SDL sprite sheet clipping
Posted: Mon Oct 18, 2010 2:33 am
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!
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!