I've been thinking, and I have some ideas as to how to rotate/flip sprites from a sprite sheet, but I don't have time to test them and I wanted the opinions of you guys.
So that you can flip/rotate individual sprites instead of an entire spritesheet, would it be possible to load the spritesheet, blit the sprite to another surface, and then use the second surface to rotate/flip it?
Thanks in advance.
Quit procrastinating and make something awesome.
Ducky wrote:Give a man some wood, he'll be warm for the night. Put him on fire and he'll be warm for the rest of his life.
You can flip the surface that the sprite is drawn on, yes, by just inverting the glTexCoord2f numbers, I think it is (#include <sdl/opengl.h> iirc), if you're using opengl with your SDL. Pure SDL flip, I'm not sure of.
Rotating an arbitrary degree is a whole 'nother matter.
I realized the moment I fell into the fissure that the book would not be destroyed as I had planned.
MarauderIIC wrote:You can rotate the surface that the sprite is drawn on, yes, by just inverting the glTexCoord2f numbers, I think it is (#include <sdl/opengl.h> iirc)
though I'm not using OGL. But thanks anyway, I know how I'll rotate/flip them, I just wanted to make sure that it was possible to split the sprite/tile sheet into multiple surfaces, then use them. Thanks again!
Edit: and the rotation is just going to be by every 90 degrees, so it'll be simple. =P
Quit procrastinating and make something awesome.
Ducky wrote:Give a man some wood, he'll be warm for the night. Put him on fire and he'll be warm for the rest of his life.