rotate image using mouse

BlitzMax Forums/BlitzMax Programming/rotate image using mouse

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

ATAN2 needs the difference between target and source coords where you're only using the target coords in mousex() and mousey()
Could be neater...
Graphics 800,600
SetColor 255,255,255

SetOrigin(GraphicsWidth()/2,GraphicsHeight()/2)
'HideMouse()

Local varx : Float
Repeat
    mx=MouseX()
    my=MouseY()
    x1 = mx-400
    y1 = my-300
	SetRotation ATan2(y1,x1)
	varx = GetRotation()
	DrawText "rotation = " + String(varx), 10,10
	Flip
	Cls

Until KeyHit(key_escape) = 1