Rotate a sprite question

BlitzMax Forums/BlitzMax Beginners Area/Rotate a sprite question

Ravl(Posted 2013) [#1]
Hello all,

I just wanted to be sure regarding this feature. I observe there is a SetRotation function and I start using it.

Basically this one sets the rotaion angle for all the sprite in my scene/game. I must call a SetRotation 0 for the spirets I do not want to be rotated, correct?

Is there another way to rotate a sprite or am I missing something?

Thank you,

R.


GfK(Posted 2013) [#2]
Basically this one sets the rotaion angle for all the sprite in my scene/game. I must call a SetRotation 0 for the spirets I do not want to be rotated, correct?
Correct.

Is there another way to rotate a sprite or am I missing something?
No. But all it does is set a single value in the translation matrix so speed is not going to be a concern. It's no slower than doing A:+1, for example.


ima747(Posted 2013) [#3]
When the rotation angle is set it doesn't change until you change it again. You could theoretically optimize by setting rotation and drawing everything that uses that rotation, then setting it to whatever for the next batch, but realistically you're going to spend a lot of time sorting things generally, and as gfk said, it's a single value adjust in the translation matrix so the overhead is beyond trivial so you don't need to worry about the time it takes to set rotation under any even remotely reasonable circumstance (i.e. you will notice slow down from MANY other things before you would notice it from even crazy amounts of rotation settings, so optimize elsewhere if you have concerns/problems)


Ravl(Posted 2013) [#4]
Thanks guys.

I need to rotate some rings for a minigame (there are only 3 sprites) so there is no 'speed problem'

back to work now!