Qbasicnews.com

Full Version: SDL rotozoomer function
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
How exactly does it work? I rotated a bitmap, and it didn't rotate based upon the centre of the object. Nor did it rotate based on the top left corner of the object. How can I set it up to rotate based on the sprite's centre?
You cant, you have to calculate it yourself..
It's because the rotated bitmap takes more room than the "original" one..
Any suggestions on how I might calculate it?
Quote:Any suggestions on how I might calculate it?
No, sorry.. if you figure it out, please share..

Maybe you could check the new size relative to the old size, and move the blitting coordinates accordingly..
I haven't used SDL much, so I don't know exactly how it's roto-zommer works, but why couldn't you just rotate the point of origin using the same angle?
Quote:I haven't used SDL much, so I don't know exactly how it's roto-zommer works, but why couldn't you just rotate the point of origin using the same angle?
Say you rotate a square image, by 45º, it will now take more room..
SDL blit's from top, left corner (like everything else)
And as the image is now larger than the original, it gets shifted down and to the right.
this could be easily done with... yagl! heh
Quote:this could be easily done with... yagl! heh
So you have a FB port? Tongue
nope just started on writting the programmers guide, after that i'll write a small wrapper at least around the gfx, sfx and input module.
I've resolved to just using allegro...
Pages: 1 2