Log In  


Would be useful to have an export option (in the console and in the command-line interface) to get the label image as a PNG, to print labels for physical carts or for emulation frontend metadata for example. Could be 'export game.label.png', using the same resolution as GIFs.

9


Now @merwok that would be nice. I 2nd this as I can definitely see a way of recalling and storing extra data in that method via console coding. Reading and recalling extra recorded data is always useful in programming.

Oh, and @zep, thanks so much for finally fixing the problem with the latest version of Pico-8 0.2.3 immediate mode inability to handle calling functions. You really are on top of it.


Little bump so that maybe zep sees this for 0.2.4c


@merwork This would be nice. If you want a workaround in the meantime, you can try my commandline tool
https://github.com/rtouk/picoknife

label command:

picoknife label {P8FILE} [OUTPUTFILE] [--scale N] [--transparent INDEX]
  [--alternate] [--palette COLORS] [--open] [--locate] [--verbose] [--silent]
  [--help]

    export label image from a .p8 file

    {required}
      P8FILE         input .p8 source file

    [optional]
      OUTPUTFILE     output image file
      -----------
      scale          upscaling factor (positive integer, such as 2)
      transparent    color index (0-15) to treat as transparent
      alternate      use PICO-8's alternate/secret color palette
      palette        use custom palette of (up to 16) comma-separated colors
      -----------
      open           open image file when finished
      locate         locate image file when finished

Fun that you made a tool! Some competition for picotool :)

However, there is no source code, and I don’t run untrusted binaries (especially not windows or mac binaries).


4

Hi @merwok
This is in for 0.2.4c, along with a matching import (which was requested somewhere else -- can't find it right now).

> EXPORT -L LABEL.PNG
-- DO SOMETHING TO IT IN AN EXTERNAL EDITOR
> IMPORT -L LABEL.PNG

:-D that's great, thanks!

is it also available as a command-line option for headless mode?


@zep Nice, it worked! Although I notice that black pixels are transparent. There could be an option to fill it with actual black, or it could be default if you assume most developers don't need a transparent label.

It's easy to fill manually though, so I'll do this for now.


Ah, I couldn't automate it even in non-headless pico8 -run mode, I get a syntax error:

Writing exactly the same code as in the cart, but in the live terminal prompt, works.

Quotes never work either way (in case file has space in name).

EDIT: found it! Whether running headless or via pico8 -run, non-interactive mode requires proper lua call. Therefore, you must use either the bracket call syntax or at least surround the single argument with quotes.

Since you need the option -l there is not a single argument, so you cannot use the quote trick (such as import "spritesheet.png"). So you must use the brackets, passing a string that contains the option and the argument, with a space between:

import metadata_label.png

becomes

import("-l metadata_label.png")

It's the same trick as when you do a complex export like export(title..".html" -i 30 -s 2 -c 14)


thanks for sharing your findings!



[Please log in to post a comment]