A Simple Center Routine - Printable Version +- QB64 Phoenix Edition (https://staging.qb64phoenix.com) +-- Forum: QB64 Rising (https://staging.qb64phoenix.com/forumdisplay.php?fid=1) +--- Forum: Prolific Programmers (https://staging.qb64phoenix.com/forumdisplay.php?fid=26) +---- Forum: SMcNeill (https://staging.qb64phoenix.com/forumdisplay.php?fid=29) +---- Thread: A Simple Center Routine (/showthread.php?tid=71) |
A Simple Center Routine - SMcNeill - 04-20-2022 The title really says it all... Code: (Select All) SCREEN _NEWIMAGE(640, 480, 32) Note that we have a 3rd parameter for our Center routine, which is for the NEWLINE option. Basically this is used to toggle between two modes of behavior: 0 -- don't move the print position location from what it previously existed. (This allows us to center text wherever we want, without losing where we were printing before.) Anything Else -- move the print position to the line directly below what we just centered, and to the left side of the screen, just as PRINT "something" would. The rest should be easy enough to figure out. |