DRAW sequence m option - Printable Version +- QB64 Phoenix Edition (https://staging.qb64phoenix.com) +-- Forum: QB64 Rising (https://staging.qb64phoenix.com/forumdisplay.php?fid=1) +--- Forum: Code and Stuff (https://staging.qb64phoenix.com/forumdisplay.php?fid=3) +---- Forum: Help Me! (https://staging.qb64phoenix.com/forumdisplay.php?fid=10) +---- Thread: DRAW sequence m option (/showthread.php?tid=1117) |
DRAW sequence m option - PhilOfPerth - 11-14-2022 Can someone please elaborate a bit on the m x,y (and its related +/- options) in the draw command? It doesn't get a mention (that I can find) in the Help file, and the Wiki one is pretty unclear. How is it fitted into a draw string, and does it need parentheses, or commas etc? RE: DRAW sequence m option - PhilOfPerth - 11-14-2022 It's okay, I thought I'd tried everything and had error every time. Turns out I hadn't specified screen mode so I was in screen 0, so no graphics. Still, I wouldn't mind a bit of tutoring in draw. Maybe "word-of-the-day" will cover this one day. RE: DRAW sequence m option - Pete - 11-14-2022 (11-14-2022, 08:47 AM)PhilOfPerth Wrote: Can someone please elaborate a bit on the m x,y (and its related +/- options) in the draw command? It doesn't get a mention (that I can find) in the Help file, and the Wiki one is pretty unclear. How is it fitted into a draw string, and does it need parentheses, or commas etc? DRAW, varmint! Schooled by Sam, who only uses a drawstring to hold up his pants. RE: DRAW sequence m option - mnrvovrfc - 11-14-2022 (11-14-2022, 08:47 AM)PhilOfPerth Wrote: Can someone please elaborate a bit on the m x,y (and its related +/- options) in the draw command? It doesn't get a mention (that I can find) in the Help file, and the Wiki one is pretty unclear. How is it fitted into a draw string, and does it need parentheses, or commas etc?You use "M" when the "turtle graphics" commands like "U", "R" and "H" aren't good enough and/or you're not interested in using "S" scale or "TA" change drawing angle which might generate more confusion. "M+2,+2" moves from the "current position" to the position two pixels across and two pixels down, toward your right-hand side of the screen and toward the bottom. It becomes the new current position. "M400,300", without any signs moves absolutely, in this case to the "middle" point of 800x600 screen. This could be combined with "B", in which case there is nothing drawn, or with "N", in which the "current position" is not changed after the "M" command is performed. For example, "M400,300 NM500,300 NM400,150" draws a horizontal line then an upper vertical line, while the "current position" remains the middle of your 800x600 screen. RE: DRAW sequence m option - Dimster - 11-14-2022 Hi Phil - been a while since I've seen this draw string stuff but if I'm remembering correctly that M need you to input the co-ordinates x,y. I think the command works like this DRAW "M+"+ the string value of the co-ordinates you want the drawing to move to. At least I think that's the way it was supposed to go. RE: DRAW sequence m option - Pete - 11-14-2022 Well lookie here, I drews a box! Now I'z can see the poorade! Code: (Select All) DRAW "d80" - Sam RE: DRAW sequence m option - Dimster - 11-14-2022 No Phil - I think I'm wrong on that - seems to me the fact the co-ordinates are in quotes already makes them string values so Draw "M3,4" is already a string value. I was originally thinking it worked like Draw "M+"+str$(3)+str$(4) Doesn't this exercise remind you of the song "Dancing in the Dark"? RE: DRAW sequence m option - Pete - 11-14-2022 Springsteen sucks! <robots-follow> Pete RE: DRAW sequence m option - mnrvovrfc - 11-14-2022 (11-14-2022, 05:47 PM)Dimster Wrote: Doesn't this exercise remind you of the song "Dancing in the Dark"?Which one, by Bruce Springsteen? You're confusing other people, there's no need to use "STR$()" unless you need to take the value of a numeric variable. Also within "M" statement for "DRAW" command, use signs only for relative move which is like "U" or "H" but could be fancier because those single-letter commands only do "straight" moves, in one direction or in diagonal. Using "M+4,+3" is line using "STEP" in some of the graphics commands like "LINE" and "PSET". You don't use signs when you want to move absolutely, as in the coordinates to give "PSET" (without "STEP" and without signs unless you're under the influence of "WINDOW"). Ah shucks I'm only causing even more confusion! RE: DRAW sequence m option - Pete - 11-14-2022 It's surprising that some developer of QBasic went to the trouble of advancing DRAW into a macro language, but never really documented it worth a damn. That stated, I swear, I never worked for M$. As stated, using DRAW with M, etc. is like Turtle Graphics, but not compatible, so getting schooled in TG would only be of some relative help. BTW - I have three books on QuickBASIC and none of them offered any explanation, other than the reference to Turtle Graphics and the macro language built into the DRAW statement. PRINT ABS(crap!) Pete |