Skip to content
Vadim Grigoruk edited this page Nov 22, 2026 · 13 revisions

Text projects (PRO feature)

This is a feature of the PRO version.
You can save (and load) your game directly as a Lua (or other script) file rather than a *.tic cart, for example:

save mygame.lua

The saved file is a text project: your code at the top and the resources (sprites, map, sfx, music, screen, palette) in tagged comment sections such as -- <TILES>, -- <SPRITES> and -- <MAP> at the end. Care should be taken to avoid manually editing this data unless intentionally required. TIC reloads the file when it changes on disk; if the cart has unsaved edits, it asks before reloading.

A typical workflow might be:

  • Create sprites, map, sfx and music in TIC's various resource editors and save in lua format from the console eg save mygame.lua
  • Open mygame.lua in your editor of choice; the resources created in the previous step will appear in the tagged sections at the end of the file. Add your code at the top of the file.
  • If TIC is open, it will detect changes to the file whenever it's saved and reload it (or ask, when the cart has unsaved changes). Switch to TIC to run your game or edit resources.
  • If TIC is not open, start it and use load mygame.lua to load your code and resources to further edit or run your game.

To avoid losing work, care should be taken to avoid making unsaved changes in an external editor and within TIC's resource editors at the same time!

Versions prior to 0.80:

These instructions are kept for old builds only. They no longer apply to current TIC-80 releases.

There are two methods by which you can run code from an external Lua file:

  1. add dofile('game.lua') as the first line of the built-in editor and place game.lua in the correct location:
  • For Windows, the file should be in the same folder as your executable.
  • For Unix/Linux it should be in the directory from which you started the tic binary.
  • For Android you need to specify the full path to your Lua file. For example, dofile('/sdcard/game.lua').
  1. use tic cart.tic -code game.lua command line parameters to inject your code to the cartridge

Extensions/packages for text editors

Home
Tips for newcomers

Built-in Editors

CodeΒ | SpritesΒ | MapsΒ | SFXΒ | Music

Console

All commands

saveΒ | exportΒ | loadΒ | importΒ | menuΒ | configΒ | surfΒ | shelfΒ | demoΒ | evalΒ 

Platform

RAMΒ | VRAMΒ | DisplayΒ | PaletteΒ | Bits per Pixel (BPP)Β | .tic FormatΒ | Supported Languages

Other

TutorialsΒ | Code SnippetsΒ | LibrariesΒ | External ToolsΒ | FFT


API

All API functions

Callbacks

TICΒ | BOOTΒ | MENUΒ | BDR

  • SCN (deprecated)
  • OVR (deprecated)

Input

btnΒ | btnpΒ | btnrΒ | keyΒ | keypΒ | keyrΒ | mouse

Drawing

circΒ | circbΒ | clipΒ | clsΒ | elliΒ | ellibΒ | fontΒ | lineΒ | mapΒ | paintΒ | pixΒ | printΒ | rectΒ | rectbΒ | rrectΒ | rrectbΒ | sprΒ | triΒ | tribΒ | ttriΒ | fill patterns

Sound

musicΒ | sfxΒ | FFTΒ | VQT

Memory

memcpyΒ | memsetΒ | mgetΒ | msetΒ | peekΒ | pokeΒ | pmemΒ | syncΒ | vbank

System

exitΒ | resetΒ | timeΒ | tstampΒ | trace

Clone this wiki locally