The FILLP() Editor

0
0
Published 2023-06-12

(v12 03-29-22)
TO LOAD THIS PICO-8 CART, in immediate mode, type: load #fillp_editor

VVHAT'S NEW ?

(03-29-22)

(03-28-22)

(03-27-22)

(03-26-22)

(03-21-22)

OVERVIEW:
This program will let you not only create single 4x4 patterns and see them as you enter them, but you can have a whole set, up to 256 if you like ! and even includes the unique 3-flags of TRANSPARENCY, SPRITE, and GLOBAL for each FILLP() pattern.

With new suggestion by beanborg you can now hold down the ❎ key and scroll with wrap ability. Just hold down the ❎ key and while it is held, press the arrow in the direction you want to scroll your pattern.

KEYS TO USE:

Note the two programming lines below the 4x4 grid seen above. This shows what value FILLP() has for the pattern you are working on and the 3-numbers above, Binary, Hexadecimal, and Decimal also appear and change every time you add or remove a pixel. As you can see in RECTFILL() you can have a pattern appear as 2-colors by adding a new colored multiplied by 16. In this case it is color 13 (violet) combined with color 12 (aqua).

Be aware that all Pico-8 patterns are not OR but AND. They REMOVE pixels from a solid pattern, not the other way around. If you want to draw a pattern but have it OR, draw what you want first, then select the INVERT button.

If there is a need to do this backwards where the results in the grid appear the same but the actual data saved and the pattern appearing above is the opposite for transparent-flagged sprites, i can do so. I could add a menu item with the regular MENUITEM() to optionally reverse the storage for transparent patterns. Just ask.

ADDITIONAL:

This pattern editor has the ability of both importing and exporting patterns.

To EXPORT your pattern or more than one if you have created more than one, move the cursor until it is in the horizontal center and then move the cursor until it is in the "5th" vertical position. The word, "EXPORT" will appear. Press 🅾️ and you will be asked some questions.

The first is, EXPORT TO HEX OR DEC? Any time the screen turns black and you have a question, you can change your answer from ? by pressing any of the 4-arrow keys. ⬆️ or ➡️ will select the next choice. ⬇️ or ⬅️ will select the previous answer.

In this instance you have choices of ?HEXDEC and ABORT

HEX means when you EXPORT the numbers will be listed in hexadecimal notation. DEC means they will be decimal and if you click ON the top-left-hand corner pixel, the number will be negative. Select ABORT of course to cancel this.

The next is, BASE ZERO OR ONE? Once again use the arrow keys to navigate the choices. In this instance you have choices of ?ZEROONE and once again ABORT

Choose ZERO if you want your array to be preceded by [0]= to force the first element to appear at array position zero, IE: patd={[0]=n1,n2,etc}

Choose ONE which is default where normal LUA arrays start at 1 (one). IE: patd={n1,n2,etc}

Make your choice again with the 🅾️ key.

If you are ONLINE a 3rd choice will appear. PRESS CTRL+C NOW! Well not really so much a question. Nonetheless from here press CTRL+C then select DID SO and 🅾️.

COPIED TO CLIPBOARD will appear. Select NICE and 🅾️.

CTRL+V WILL PASTE will appear. Select GOTCHA to confirm you understand and press 🅾️.

Then you will return back to the editor. Be aware the arrays are PATH[] for hexadecimal and PATD for decimal.

To use this in any Pico-8 code, merely press CTRL+V to paste as was instructed.

For instance, let's say you made:

and

EXPORT those two patterns.

Now start a new Pico-8 session by either ending FILLP EDITOR or starting a new task, and type out the following in source code:

The print() command will move the cursor out of the way of the rectangle.

Your code should now appear as:

Notice that the 1st pattern has a fractional number. That is because if you look at the two patterns above, the 1st one has the "T" flag lit for TRANSPARENT as we set it.

RUN or press CTRL+R to run this program and be aware of the output:

You can see that the dark blue peeks through because of the transparency flag set for this pattern. While you cannot change the background color in this pattern, you CAN change the foreground by changing the last line thus:
rectfill(0,0,31,31,8)
And there you have RED with transparent pattern.

To see the next pattern, if you change the next-to-last line to read, 1 instead of 0 (zero) you will have:

You will have the 2nd pattern with the exception that the background color is BLACK.

To force a background color for the output, merely add a new number multiplied by 16.

So you would get the following:

rectfill(0,0,31,31) ...

[16x16]

rectfill(0,0,31,31,7+2*16) ...
[16x16]

rectfill(0,0,31,31,2+7*16) ...
[16x16]

rectfill(0,0,31,31,14) ...
[16x16]

rectfill(0,0,31,31,4+8*16) ...
[16x16]

To load existing pattern data, copy the entire single programming line to the clipboard, it can be from any source including Pico-8, Online web browser, or even Notepad. Run this program again. This time move the pointer all the way up to select IMPORT. Follow the instructions there including to press CTRL+V to authorize paste text. Provided it is exactly as you pasted it earlier, it will be loaded back in the editor where you can make further changes.

Here is a sample program that includes the data clipped from the FILLP()Editor and makes use of transparent patterns. Press 🅾️ to do a fancy screen wipe with patterns and change the screen.

(v4 03-29-22)
TO LOAD THIS PICO-8 CART, in immediate mode, type: load #fillp_demo

VVHAT'S NEW ?

(03-29-22)

Here is the pattern table used in the demo if you'd like to examine it in the editor:

To do so, left mouse button triple click to highlight it. Press CTRL+C. Then run my editor. Select IMPORT and examine all unique patterns.

Hope This Helps ! If you have any questions or suggestions, feel free to enter them below. :)