RotateImage equivalent

BlitzMax Forums/BlitzMax Programming/RotateImage equivalent

RustyKristi(Posted 2017) [#1]
I'm looking for an equivalent RotateImage routine in Max2D

http://www.blitzbasic.com/bpdocs/command.php?name=RotateImage

Maybe there are some good working snippets already posted somewhere? but I can't find anything in search or google.


xlsior(Posted 2017) [#2]
In Blitzmax, rotation, transparancy, color, etc. are all modifiers that apply to any image drawn afterwards:

SetRotation(45)
Drawimage(Image,100,100)
SetRotation(0)


Unlike BlitzPlus, Blitzmax is 2D-in-3D, which means that any of the drawing operations like scaling, rotation, transparancy, etc. are 3D accelerated by the videocard with very little overhead, so you do it all in real time without performance impact.

You can use AutoMidHandle to have the image rotate around its center point, or you can use SetHandle to specify the x-y location of the image that's the rotation point.

Related to this, there's SetColor, SetBlend, SetAlpha, SetScale etc. (You can flip an image horizontally by using SetScale(-1,1) )


RustyKristi(Posted 2017) [#3]
Thanks xlsior, I will try out the modifiers you suggested here.


coffeedotbean(Posted 2017) [#4]
Function SetTransform( rotation#=0,scale_x#=1,scale_y#=1 )

is also avaliable


John G(Posted 2017) [#5]
With OddBall's extensions you can also "SetScreenRotation" which I've found very, very useful. Thanks to Brucey (and my wining), I believe these extensions have already been ported to BlitzMax NG. Couldn't do 2D graphics without them.


RustyKristi(Posted 2017) [#6]
Thanks guys for the additional info!