Web
Analytics
Log In  

3

Cart [#56400#] | Copy | Code | 2018-09-08 | Link
3

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.

Keys:

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.

fill pattern tool fillp
P#56401 2018-09-08 06:20 ( Edited 2018-09-12 21:16)

::

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.

P#56424 2018-09-08 19:17 ( Edited 2018-09-08 19:17)

::

Bump, Neomech. Can you update this please ?

P#56492 2018-09-10 15:03

::

Hey dw817,

Perhaps give Neomech more than a couple of days to respond to your demands?
Unfortunately, not everyone be active every day on the BBS. :o/

P#56513 2018-09-11 01:28

::

No worries, LD. :) Like the postman, I only ask twice on any inquiry.

P#56524 2018-09-11 12:56 ( Edited 2018-09-11 17:37)

::

Hi dw817,

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:

http://pico-8.wikia.com/wiki/Fillp

hope that helps you.

P#56563 2018-09-12 09:11

::

Thanks! This will be very useful for designing patterns! (Like 0x1A48, a pretty cool looking diagonal brick pattern!)

P#56567 2018-09-12 09:30

::

Hi NeoMech:

  • 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.

P#56570 2018-09-12 11:48

::

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).

P#56582 2018-09-12 16:07 ( Edited 2018-09-12 17:13)

::

Oh ! That's the part I didn't understand, that you can can set 2-colors per graphic element by going greater than 16, in this case 104.

That was the missing piece to my puzzle. Thanks, Neomech !

P#56590 2018-09-12 21:16

Log in to post a comment

user:
password:

New User | Account Help
:: New User
X
About | Contact | Updates | Terms of Use
Follow Lexaloffle:        
Generated 2018-11-21 10:28 | 0.154s | 1835k | Q:26