The export .lua.png command is used to save the entire code of your game as a single large image of all tabs in the code editor.
Any code that trails off the right beyond 192 pixels will be cropped out. That is 64 pixels beyond the single visible PICO-8 screen of 128 pixels. It will fit about 48 characters wide in a single line.
Tabs will be reduced to single character width spaces regardless of your tab_width config setting. However if you have the draw_tabs config setting turned on, then the tab lines will be included in the export.
Example of a full size code image (shrunk to fit webpage, real size: 1920x1314 pixels):
( Exported Code of "Jelpi" Demo Cart by Zep )
Example of how having a small amount code will auto crop the image (displayed as real size: 192x66 pixels):
The height of the image is adjusted to break into columns of code. The breakpoint is not a fixed pixel nor line number. And as you can see below, the export will respect the whitespace (spaces, tabs, new lines) of multi-line strings.
Why would you want this?
Certainly not to share your code with others! Oh, no, no no. But what if you are quite proud of the very first game you ever make in PICO-8, or the largest or most popular game project you have made? Well imagine exporting the full code as an image, printing it out, framing it, and hanging it on your wall! Now that is a beautifully nerdy trophy if we do say so ourselves!
Speaking of art hanging on your wall, just imagine the ascii art you could create inside of the code editor and export it at a resolution much larger than the PICO-8 screen!
17 May 2023