Rotating a single image

BlitzMax Forums/BlitzMax Beginners Area/Rotating a single image

I only got BMax today and i am stuck with a whole load of commands.

I used SetRotation and that rotates all the images, how do i rotate a specific image?

You don't -- it's a global rotation, so you rotate an image, draw it, then change the rotation for the next image/s.

you could of course, create a wrapper function, something like:

Function DrawImageEx(Image:TImage, X#, Y#, Frame:Int, Rotation#=0, ScaleX#=1.0, ScaleY#=1.0)
	Local OldRot# = GetRotation()
	Local OldScaleX#, OldScaleY#
	
	GetScale(OldScaleX, OldScaleY)
	SetRotation(Rotation)
	SetScale(ScaleX, ScaleY)
	DrawImage(Image, X, Y, Frame)
	SetRotation(OldRot)
	SetScale(OldScaleX, OldScaleY)
End Function