Import: Difference between revisions

From Pico-8 Wiki
Jump to navigation Jump to search
imported>ZOSK1712
No edit summary
imported>Felice Enellen
m (links)
 
(4 intermediate revisions by the same user not shown)
Line 6: Line 6:
This command imports a specially formatted PNG image file to be the sprite sheet for the current cartridge. The file must be 128 pixels wide, 128 pixels tall, and use the PICO-8 palette (otherwise the file will be clipped, and the colors will be set to the closest PICO-8 color).
This command imports a specially formatted PNG image file to be the sprite sheet for the current cartridge. The file must be 128 pixels wide, 128 pixels tall, and use the PICO-8 palette (otherwise the file will be clipped, and the colors will be set to the closest PICO-8 color).


To edit the sprite sheet in an external graphics editing program, use the [[Export|export]] command to make a PNG image file with the correct properties, edit it in the external editor, then use the <code>import</code> command to update the cartridge. You can set up the palette in your editor by placing some of each color on the sprite sheet within PICO-8, then sampling the exported file.
To edit the sprite sheet in an external graphics editing program, use the <code>[[export]]</code> command to make a PNG image file with the correct properties, edit it in the external editor, then use the <code>import</code> command to update the cartridge. You can set up the palette in your editor by placing some of each color on the sprite sheet within PICO-8, then sampling the exported file.


To transfer a sprite sheet from one cartridge to another, [[Export|export]] it from the first cartridge, then <code>import</code> it into the second cartridge.
To transfer a sprite sheet from one cartridge to another, export it from the first cartridge, then <code>import</code> it into the second cartridge.


== Examples ==
== Examples ==
<pre>
<pre class="p8sh">
> import sprites.png
> import sprites.png
</pre>
</pre>
Line 18: Line 18:


* [[Graphics]]
* [[Graphics]]
* [[Export|export]]
* <code>[[export]]</code>
[[Category:Reference]]
[[Category:Reference]]
[[Category:Command]]
[[Category:Command]]

Latest revision as of 14:34, 13 March 2021

import filename
Imports a PNG image file as sprite data.
filename
The .png graphics file to import.

This command imports a specially formatted PNG image file to be the sprite sheet for the current cartridge. The file must be 128 pixels wide, 128 pixels tall, and use the PICO-8 palette (otherwise the file will be clipped, and the colors will be set to the closest PICO-8 color).

To edit the sprite sheet in an external graphics editing program, use the export command to make a PNG image file with the correct properties, edit it in the external editor, then use the import command to update the cartridge. You can set up the palette in your editor by placing some of each color on the sprite sheet within PICO-8, then sampling the exported file.

To transfer a sprite sheet from one cartridge to another, export it from the first cartridge, then import it into the second cartridge.

Examples

> import sprites.png

See also