Pico-8 API Documentation

Configuration

Configuration

config.txt

You can find some settings in config.txt. Edit the file when PICO-8 is not running.

  • Windows: C:/Users/Yourname/AppData/Roaming/pico-8/config.txt
  • OSX: /Users/Yourname/Library/Application Support/pico-8/config.txt
  • Linux: ~/.lexaloffle/pico-8/config.txt

Use the -home switch (below) to use a different path to store config.txt and other data.

  • Some settings can be changed while running PICO-8 by typing CONFIG SETTING VALUE.
  • type CONFIG by itself for a list

Commandline parameters

pico-8 [switches] [filename.p8]
-width n set the window width
-height n set the window height
-windowed n set windowed mode off (0) or on (1)
-volume n set audio volume 0..256
-joystick n joystick controls starts at player n (0..7)
-pixel_perfect n 1 for unfiltered screen stretching at integer scales (on by default)
-preblit_scale n scale the display by n before blitting to screen (useful with -pixel_perfect 0)
-draw_rect x,y,w,h absolute window coordinates and size to draw pico-8's screen
-run filename load and run a cartridge
-x filename execute a PICO-8 cart headless and then quit (experimental!)
-export param_str run EXPORT command in headless mode and exit (see notes under export)
-p param_str pass a parameter string to the specified cartridge
-splore boot in splore mode
-home path set the path to store config.txt and other user data files
-root_path path set the path to store cartridge files
-desktop path set a location for screenshots and gifs to be saved
-screenshot_scale n scale of screenshots. default: 3 (368x368 pixels)
-gif_scale n scale of gif captures. default: 2 (256x256 pixels)
-gif_len n set the maximum gif length in seconds (1..120)
-gui_theme n use 1 for a higher contrast editor colour scheme
-timeout n how many seconds to wait before downloads timeout (default: 30)
-software_blit n use software blitting mode off (0) or on (1)
-foreground_sleep_ms n how many milliseconds to sleep between frames.
-background_sleep_ms n how many milliseconds to sleep between frames when running in background
-accept_future n use 1 to allow loading cartridges made with future versions of PICO-8

Controller Setup

PICO-8 uses the SDL2 controller configuration scheme. It will detect common controllers startup on startup and also looks for custom mappings in sdl_controllers.txt in the same directory as config.txt. sdl_controllers.txt has one mapping per line.

To generate a custom mapping string for your controller, use either the controllermap program that comes with SDL2, or try http://www.generalarcade.com/gamepadtool/

To find out the id of your controller as it is detected by SDL2, search for "joysticks" or "Mapping" in log.txt after running PICO-8. This id may vary under different operating systems. See: https://www.lexaloffle.com/bbs/?tid=32130

To set up which keyboard keys trigger joystick buttons presses, use KEYCONFIG.

Screenshots, Videos and Cartridge Labels

While a cartridge is running use:

  • CTRL+6 Save a screenshot to desktop
  • CTRL+7 Capture cartridge label image
  • CTRL+8 Start recording a video
  • CTRL+9 Save GIF video to desktop (8 seconds by default)
  • You can save a video at any time (it is always recording); CTRL-8 simply resets the video starting point. To record more than 8 seconds, use the CONFIG command (maximum: 120)

CONFIG GIF_LEN 60

  • If you would like the recording to reset every time (to create a non-overlapping sequence), use:

CONFIG GIF_RESET_MODE 1

The gif format can not match 30fps exactly, so PICO-8 instead uses the closest match: 33.3fps.

If you have trouble saving to the desktop, try configuring an alternative desktop path in config.txt

Edit this page on GitHub