Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Another Mouse Issue?
#4
(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
New to QB64pe? Visit the QB64 tutorial to get started.
QB64 Tutorial
Reply


Messages In This Thread
Another Mouse Issue? - by NakedApe - 04-25-2024, 12:54 AM
RE: Another Mouse Issue? - by SMcNeill - 04-25-2024, 01:06 AM
RE: Another Mouse Issue? - by TerryRitchie - 04-25-2024, 01:40 AM
RE: Another Mouse Issue? - by NakedApe - 05-01-2024, 11:42 PM
RE: Another Mouse Issue? - by SMcNeill - 05-02-2024, 12:23 AM
RE: Another Mouse Issue? - by Pete - 04-25-2024, 01:27 AM
RE: Another Mouse Issue? - by bplus - 04-25-2024, 01:42 AM
RE: Another Mouse Issue? - by TerryRitchie - 04-25-2024, 02:08 AM
RE: Another Mouse Issue? - by NakedApe - 04-25-2024, 02:16 AM
RE: Another Mouse Issue? - by TerryRitchie - 04-25-2024, 05:33 AM
RE: Another Mouse Issue? - by a740g - 04-26-2024, 02:23 AM
RE: Another Mouse Issue? - by bplus - 04-25-2024, 11:50 AM
RE: Another Mouse Issue? - by NakedApe - 04-25-2024, 04:11 PM
RE: Another Mouse Issue? - by TerryRitchie - 04-25-2024, 05:43 PM
RE: Another Mouse Issue? - by NakedApe - 04-26-2024, 06:19 AM
RE: Another Mouse Issue? - by TerryRitchie - 05-02-2024, 12:31 AM
RE: Another Mouse Issue? - by SMcNeill - 05-02-2024, 12:31 AM
RE: Another Mouse Issue? - by NakedApe - 05-02-2024, 03:16 AM



Users browsing this thread: 2 Guest(s)