This is a small tool I wrote to help me visualize fill patterns for the fillp() function. I thought other people may find it useful so I posted it here.
The bit pattern is shown in hex below the pattern grid. You can select the colours to use and see a preview of the pattern in the lower half of the screen.
Cursor keys - move marker in grid
Z - change pattern bit or select colour
X - swap between colour grid and pattern grid.
or use the mouse.
I'm liking this tutorial, Neomech.
Could you please include a small bit of visible code in the demo showing the color selections as well as the commands used to select the pattern and drawing the rectangle ?
color(xx) if needed fillp() rect()
Filling in a region with a colored pattern is pretty new for me to understand.
as Liquidream kindly pointed out I don't check this forum that often.
This cart was not really intended to be a tutorial, but rather a tool to help me interactively visualize patterns of colours, and I thought that others may find it useful for that too which is why I posted it.
Filling rectangles with colours is a pretty trivial process and only requires 2 lines of code such as this:
fillp(0x5a5a) rectfill(0,0,128,128, 0x3a)
this page explains it much better than i can:
hope that helps you.
- Thanks for this information and your program. I guess what was confusing me was how to create a =2= color pattern. This code shows thus:
cls() circfill(80, 80, 10, 6) fillp(0b0011001111001100.1) circfill(80, 80, 10, 8)
I thought it was something more complex. Guess not.
Thanks to your info I can now add PATTERNS to the paint program I'm working on.
you don't need to call circfill twice, you can specify both colours at once.
fillp(0b0011001111001100) circfill(80, 80, 10, 0x68)
this is explained in the page I linked:
the color parameter to the drawing functions (such as circfill()) can set two colors, to be used for the on bits (1's) and off bits (0's) of the pattern. The four lower bits of the color value are the "on" color, and the higher bits are the "off" color. For example, to draw the on bits as light blue (12, or 0xc) and the off bits as dark blue (1), set the color to 0x1c (28).
Log in to post a comment