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.
SDL separating sprites
Moderator: Coders of Rage
- Ginto8
- ES Beta Backer
- Posts: 1064
- Joined: Tue Jan 06, 2009 4:12 pm
- Programming Language of Choice: C/C++, Java
SDL separating sprites
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.
- MarauderIIC
- Respected Programmer
- Posts: 3406
- Joined: Sat Jul 10, 2004 3:05 pm
- Location: Maryland, USA
Re: SDL separating sprites
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.
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.
- Ginto8
- ES Beta Backer
- Posts: 1064
- Joined: Tue Jan 06, 2009 4:12 pm
- Programming Language of Choice: C/C++, Java
Re: SDL separating sprites
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!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)
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.