Log In  


Cart #p8mtoo-1 | 2022-12-06 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
3

(v01 12-05-22)
TO LOAD THIS PICO-8 CART
, in immediate mode, type: load #p8mtoo

This cart is designed for offline use and will let you select any area from your spritesheet and draw it in any other code or even a different cart - without using the spritesheet.

Use the arrow keys to navigate.
Try selecting any of the color rectangles to test the system.
Hold down the CTRL key to jump in a grid of 8x8.
Hold down the SHIFT key to start selecting an area. The area is inclusive so the cursor must touch the area borders you want to select.

Hold down BOTH CTRL and SHIFT to select in fields of 8x8 where the box is 8*size-1

Press SPACEBAR to save it to the clipboard and you are all set !


Hello there.

I am working on a cart where I have need of both sprite space and mapper space for data yet I need to draw a few elements on the screen. It doesn't need to be very fast for me though.

So I came up with "More Than One Off." Essentially it is a simple program that lets you select any area in the spritesheet, not limited to 8x8 grid, you can select pixels as small as a 2x2 area, save it to a simple string, then let you draw it later.

You are encouraged to run more than one Pico-8 task at a time to get the most benefit from this cart.

It is also geared to work with more than one-color at a time is why it's called, "More than one off."

Also you can import your own spritesheet if you like to here. You are not limited to the selection I have here and this cart will work in any size, it is not limited to 8x8 or even 8x8 areas. 1x15 pixels or even 117x1 pixels are also possible.

For instance, here is a sprite, 8x8 pixels in size:

[8x8]

{gfx}0808444444404888884048999840489a984048999840488888404444444000000000{/gfx}

Yet for my program we only need the 7x7, not the far bottom or right pixels, so it's actually a bit smaller than copying a single sprite cel, 49x49 versus 64x64.

pic="♥●eeeeeeeeiiiiieeijjjieeijkjieeijjjieeiiiiieeeeeeee"

Then to plot it it's, strspr(pic,x,y) and that's it !

To import your own spritesheet use: import spritesheet.png

Then run this program. Once you have selected the area you want, hit SPACEBAR and it saves that area to the clipboard where it can be pasted in this code or another.

Then you just call the strspr() function which is 72-tokens or 145-characters in size to recall the 16-color image clipping.

-- p = sprite image string
-- x = x-coordinates
-- y = y-coordinates
-- v = if yes, overwrite black
--  72-tokens
-- 145-characters
function strspr(p,x,y,v)

It is not geared for speed but brevity and should cover your needs if you too need to use the entire spritesheet for something other than drawing.

The animated dotted bar pattern was made with this tool:

https://www.lexaloffle.com/bbs/?tid=47049

If you find this program good and useful, please let me know !

Thanks !

3



[Please log in to post a comment]