Simple Brick Pattern Fill Question - 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: Simple Brick Pattern Fill Question (/showthread.php?tid=2218) |
Simple Brick Pattern Fill Question - NakedApe - 12-01-2023 I came upon this in Help. I like what it does, but don't get how it works. How do the CHR$(&H0)s and CHR$(&HEF)s create the string pattern to be filled? I understand the &H definition in Help is hex base 16 format, but that's as far as I go... Thanks! DIM Row$(1 TO 8) SCREEN 12 'make red-brick wall Row$(1) = CHR$(&H0) + CHR$(&H0) + CHR$(&HFE) + CHR$(&HFE) Row$(2) = Row$(1) Row$(3) = Row$(1) Row$(4) = CHR$(&H0) + CHR$(&H0) + CHR$(&H0) + CHR$(&H0) Row$(5) = CHR$(&H0) + CHR$(&H0) + CHR$(&HEF) + CHR$(&HEF) Row$(6) = Row$(5) Row$(7) = Row$(5) Row$(8) = Row$(4) Tile$ = Row$(1) + Row$(2) + Row$(3) + Row$(4) + Row$(5) + Row$(6) + Row$(7) + Row$(8) LINE (59, 124)-(581, 336), 14, B 'yellow box border to paint inside PAINT (320, 240), Tile$, 14 'paints brick tiles within yellow border RE: Simple Brick Pattern Fill Question - SMcNeill - 12-01-2023 Screen 12 is a 256 color screen, so each of those CHR$ characters are a color. CHR$(0) = Black. CHR$(?? -- translate that hex) = Brick Orange-Red BBOO BBOO BBOO BBBB BBOO BBOO BBOO BBBB And repeat that for the fill pattern. RE: Simple Brick Pattern Fill Question - SMcNeill - 12-01-2023 (May need to rotate it 90 degrees as screens are read down then right instead of right then down.) RE: Simple Brick Pattern Fill Question - NakedApe - 12-01-2023 (12-01-2023, 07:37 PM)SMcNeill Wrote: (May need to rotate it 90 degrees as screens are read down then right instead of right then down.)OK, gotcha. Thanks! |