![]() |
Is there a way to get the current graphics cursor position? - Printable Version +- QB64 Phoenix Edition (https://qb64phoenix.com/forum) +-- Forum: QB64 Rising (https://qb64phoenix.com/forum/forumdisplay.php?fid=1) +--- Forum: Code and Stuff (https://qb64phoenix.com/forum/forumdisplay.php?fid=3) +---- Forum: Help Me! (https://qb64phoenix.com/forum/forumdisplay.php?fid=10) +---- Thread: Is there a way to get the current graphics cursor position? (/showthread.php?tid=1982) |
Is there a way to get the current graphics cursor position? - Dav - 09-09-2023 I've been playing with the DRAW command lately. It's such a powerful command, and one I haven't fully explored/learned. I know you can set the graphics cursor position using PSET, and also using commands in the DRAW statement, but I was wondering how to get where the current graphics cursor position DRAW is at? For instance, in this code below how would I know when DRAWs graphics cursor position goes off screen here so I could reset it? (BTW, @dbox, running this in QBJS, the output is different) - Dav Code: (Select All)
RE: Is there a way to get the current graphics cursor position? - mnrvovrfc - 09-09-2023 https://qb64phoenix.com/qb64wiki/index.php/POINT Check out `POINT(0)` and `POINT(1)`. RE: Is there a way to get the current graphics cursor position? - Dav - 09-09-2023 (09-09-2023, 08:33 PM)mnrvovrfc Wrote: https://qb64phoenix.com/qb64wiki/index.php/POINT Oh great! I didn’t know about those POINT options. (Or forgot them). Thanks for the quick reply! - Dav RE: Is there a way to get the current graphics cursor position? - dbox - 09-09-2023 (09-09-2023, 08:26 PM)Dav Wrote: (BTW, @dbox, running this in QBJS, the output is different)Looks like DRAW is working the same. The issue is that QBJS is going to see p and p$ as the same variable. Changing this makes the result much closer to QB64. RE: Is there a way to get the current graphics cursor position? - bplus - 09-09-2023 Interesting what happens to that code with a Cls in the loop. RE: Is there a way to get the current graphics cursor position? - Dav - 09-10-2023 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)
RE: Is there a way to get the current graphics cursor position? - dbox - 09-10-2023 It looks like the position is not being reset to the center on the Cls call. I'll add it to the fix list. In the meantime you could explicitly set it with a call to PRESET: Very cool, by the way. RE: Is there a way to get the current graphics cursor position? - Dav - 09-10-2023 Thanks, @dox! I think I like the patterns much better without colors. Just change the DRAW line to read: DRAW ps$ + a$ - Dav RE: Is there a way to get the current graphics cursor position? - GareBear - 09-10-2023 Dav, I like the color and the white versions. It works very well. |