What is the point of 'SetRotation()'

BlitzMax Forums/BlitzMax Beginners Area/What is the point of 'SetRotation()'

JBR(Posted 2015) [#1]
All it seems to do is rotate the screen around the top left.

If I have an image, how do I rotate it about any point within the image?

Jim


xlsior(Posted 2015) [#2]
SetRotation doesn't rotate the screen, it rotates any subsequent image draw operating.

If you want to rotate an image around its center, you can use MidImageHandle() to change its drawing location handle to its center, then use Setrotate() to specify the angle, then draw your image.

You then have to use Setrotation() AGAIN to reset it to zero before drawing anything else to make sure that the next image won't get drawn rotated too.

Oh -- and something slightly related, you can use SetScale() to flip an image horizontally or vertically in case you need it.

Setscale 1,1 will reset to 'normal'
SetScale -1,1 will draw it flipped horizontally
Setscale 1,-1 will draw it flipped vertically

Like the others, it will affect any subsequent drawing operation untill you reset it again with Setscale 1,1


JBR(Posted 2015) [#3]
Thanks, xlsior. Also found the SetImageHandle() for off centre setting.
Jim