Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Is there a way to get the current graphics cursor position?
#6
Thanks for the help.  I put together a small DRAW pattern maker.  Press ENTER to keep making new patterns. Some reason only the first pattern shows in QBJS.  I'll tinker with DRAW more tomorrow.

- Dav

Code: (Select All)

'DRAWPATTERNS.BAS
'Generates pattern using DRAW
'Coded by Dav, SEP/2023

SCREEN _NEWIMAGE(600, 600, 32)

RANDOMIZE TIMER

DIM p, ps$, ang, a$, angrand, prand '<- for QBJS compat

DO
    CLS 'clears and resets DRAW to middle of screen
    angrand = 90 + (RND * 240) 'make random angle
    prand = RND * 5 + 1 'make random pixel size
    ang = 0: p = 0
    DO
        p = p + prand
        ps$ = "D" + STR$(p)
        ang = ang + angrand
        a$ = "TA" + STR$(ang)
        DRAW ps$ + a$ + "C" + STR$(_RGBA(RND * 255, RND * 255, RND * 255, RND * 255))
    LOOP UNTIL POINT(0) < 0 AND POINT(1) < 0
    PRINT "ENTER for another one...";
    LOCATE 2, 1: PRINT INT(prand); INT(angrand); 'show pixel size and angle #
    SLEEP
LOOP

Find my programs here in Dav's QB64 Corner
Reply


Messages In This Thread
RE: Is there a way to get the current graphics cursor position? - by Dav - 09-10-2023, 04:10 AM



Users browsing this thread: 1 Guest(s)