04-25-2024, 01:40 AM
(04-25-2024, 01:06 AM)SMcNeill Wrote: Mouse your mouse events outside the update loop:LOL. Mouse your mouse events, cracked me up. I find myself doing these types of typos all the time.
But Steve is correct, the only thing that should be done within a mouse update loop is gathering scroll wheel events. Here's a demo of that:
Code: (Select All)
SCREEN _NEWIMAGE(800, 600, 32)
radius = 50
DO
_LIMIT 60
CLS
LOCATE 2, 2: PRINT "_MOUSEHWEEL OUTSIDE THE UPDATE LOOP"
LOCATE 4, 2: PRINT "Use mouse wheel to change size of circle"
LOCATE 6, 2: PRINT "PRESS ANY KEY TO MOVE _MOUSEWHEEL INSIDE THE LOOP"
WHILE _MOUSEINPUT: WEND
radius = radius + _MOUSEWHEEL * 5
IF radius < 5 THEN radius = 5
CIRCLE (_MOUSEX, _MOUSEY), radius
_DISPLAY
LOOP UNTIL INKEY$ <> ""
DO
_LIMIT 60
CLS
LOCATE 2, 2: PRINT "_MOUSEHWEEL NOW INSIDE THE UPDATE LOOP"
LOCATE 4, 2: PRINT "Use mouse wheel to change size of circle"
LOCATE 6, 2: PRINT "PRESS ESC TO EXIT"
WHILE _MOUSEINPUT
radius = radius + _MOUSEWHEEL * 5
IF radius < 5 THEN radius = 5
WEND
CIRCLE (_MOUSEX, _MOUSEY), radius
_DISPLAY
LOOP UNTIL _KEYDOWN(27)
SYSTEM