07-11-2022, 12:02 PM
Mouse Angle in a Basic Screen from center in Degrees:
Code: (Select All)
Screen _NewImage(600, 600, 32)
_ScreenMove 300, 0
Do
Cls
Line (150, 300)-(450, 300)
Line (300, 150)-(300, 450)
_PrintString (120, 292), "180"
_PrintString (460, 292), "0"
_PrintString (288, 130), "270"
_PrintString (292, 455), "90"
While _MouseInput: Wend
mx = _MouseX: my = _MouseY
Line (300, 300)-(mx, my)
a = Int(100 * _R2D(_Atan2(my - 300, mx - 300))) / 100
If a < 0 Then a = a + 360
Print "Mouse Angle in a Basic Screen from center is:"; a
_Display
_Limit 60
Loop Until _KeyDown(27) 'escape
b = b + ...