Skip to main content

On Sale: GamesAssetsToolsTabletopComics
Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

TIC-80

Fantasy computer for making, playing and sharing tiny games. · By Nesbox

Configure system font and palette in TIC 0.16.0

A topic by Nesbox created Jan 26, 2017 Views: 2,851 Replies: 7
Viewing posts 1 to 5
Developer (3 edits)

config.lua file added to TIC working folder and it has two global variables FONT and PALETTE

here is an example

local WideFont =
    "......  ..##..  .#.#..  .#.#..  .####.  #...#.  .#....  ..#...  ..#...  .#....  ..#...  ......  ......  ......  ......  ....#.  "..
    "......  ..##..  .#.#..  #####.  #.#...  ...#..  #.#...  .#....  .#....  ..#...  #.#.#.  ..#...  ......  ......  ......  ...#..  "..
    "......  ..##..  ......  .#.#..  .###..  ..#...  .##.#.  ......  .#....  ..#...  .###..  .###..  ......  .###..  ......  ..#...  "..
    "......  ......  ......  #####.  ..#.#.  .#....  #..#..  ......  .#....  ..#...  #.#.#.  ..#...  .##...  ......  .##...  .#....  "..
    "......  ..##..  ......  .#.#..  ####..  #...#.  .##.#.  ......  ..#...  .#....  ..#...  ......  ..#...  ......  .##...  #.....  "..
    "......  ......  ......  ......  ......  ......  ......  ......  ......  ......  ......  ......  .#....  ......  ......  ......  "..
    "                                                                                                                                "..
    "                                                                                                                                "..
    ".###..  .##...  ####..  #####.  ..##..  #####.  .###..  #####.  .###..  .###..  .##...  .##...  ...#..  ......  .#....  .####.  "..
    "##..#.  ###...  ...##.  ...##.  .###..  ##....  ##....  ...##.  ##..#.  ##..#.  .##...  .##...  ..#...  .###..  ..#...  ...##.  "..
    "##..#.  .##...  .###..  ..##..  ##.#..  ####..  ####..  ..##..  .###..  .####.  ......  ......  .#....  ......  ...#..  ..##..  "..
    "##..#.  .##...  ##....  #..##.  #####.  ...##.  ##..#.  .##...  ##..#.  ....#.  .##...  .##...  ..#...  .###..  ..#...  ......  "..
    ".###..  ####..  #####.  .###..  ...#..  ####..  .###..  ##....  .###..  .###..  .##...  ..#...  ...#..  ......  .#....  ..##..  "..
    "......  ......  ......  ......  ......  ......  ......  ......  ......  ......  ......  .#....  ......  ......  ......  ......  "..
    "                                                                                                                                "..
    "                                                                                                                                "..
    ".###..  .###..  ####..  .###..  ####..  #####.  #####.  .####.  ##..#.  .####.  #####.  ##..#.  ##....  ##.##.  ##..#.  .###..  "..
    "#.#.#.  ##..#.  ##..#.  ##..#.  ##..#.  ##....  ##....  ##....  ##..#.  ..##..  ...##.  ##.#..  ##....  #####.  ###.#.  ##..#.  "..
    "#.###.  ##..#.  ####..  ##....  ##..#.  ####..  ####..  ##.##.  #####.  ..##..  ...##.  ###...  ##....  #####.  #####.  ##..#.  "..
    "#.....  #####.  ##..#.  ##..#.  ##..#.  ##....  ##....  ##..#.  ##..#.  ..##..  ##.##.  ##.#..  ##....  #.#.#.  ##.##.  ##..#.  "..
    ".###..  ##..#.  ####..  .###..  ####..  #####.  ##....  .####.  ##..#.  .####.  .###..  ##..#.  #####.  #...#.  ##..#.  .###..  "..
    "......  ......  ......  ......  ......  ......  ......  ......  ......  ......  ......  ......  ......  ......  ......  ......  "..
    "                                                                                                                                "..
    "                                                                                                                                "..
    "####..  .###..  ####..  .####.  .####.  ##..#.  ##..#.  #...#.  ##..#.  .##.#.  #####.  .##...  #.....  .##...  ..#...  ......  "..
    "##..#.  ##..#.  ##..#.  ###...  ..##..  ##..#.  ##..#.  #.#.#.  ##..#.  .##.#.  ..##..  .#....  .#....  ..#...  .#.#..  ......  "..
    "##..#.  ##..#.  ##..#.  .###..  ..##..  ##..#.  ##..#.  #####.  .###..  .####.  .##...  .#....  ..#...  ..#...  #...#.  ......  "..
    "####..  ##..#.  ####..  ..###.  ..##..  ##..#.  .###..  #####.  ##..#.  ..##..  ##....  .#....  ...#..  ..#...  ......  ......  "..
    "##....  .###..  ##..#.  ####..  ..##..  .###..  ..#...  ##.##.  ##..#.  ..##..  #####.  .##...  ....#.  .##...  ......  .####.  "..
    "......  ....#.  ......  ......  ......  ......  ......  ......  ......  ......  ......  ......  ......  ......  ......  ......  "..
    "                                                                                                                                "..
    "                                                                                                                                "..
    ".#....  ......  ##....  ......  ...##.  ......  ..###.  ......  ##....  ..##..  ...##.  ##....  .##...  ......  ......  ......  "..
    "..#...  .####.  ####..  .####.  .####.  .###..  .##...  .###..  ####..  ......  ......  ##..#.  .##...  ##.#..  ####..  .###..  "..
    "......  #..##.  ##..#.  ###...  #..##.  ##.##.  #####.  #..##.  ##..#.  .###..  ...##.  ####..  .##...  #####.  ##..#.  ##..#.  "..
    "......  #..##.  ##..#.  ###...  #..##.  ###...  .##...  #####.  ##..#.  ..##..  ...##.  ##..#.  .##...  #.#.#.  ##..#.  ##..#.  "..
    "......  .####.  ####..  .####.  .####.  .###..  .##...  ...##.  ##..#.  .####.  #..##.  ##..#.  ..###.  #.#.#.  ##..#.  .###..  "..
    "......  ......  ......  ......  ......  ......  ......  .###..  ......  ......  .###..  ......  ......  ......  ......  ......  "..
    "                                                                                                                                "..
    "                                                                                                                                "..
    "......  ......  ......  ......  .##...  ......  ......  ......  ......  ......  ......  ..##..  ..#...  .##...  ......  ......  "..
    "####..  .####.  ####..  ..###.  #####.  #..##.  ##..#.  #...#.  ##.##.  #..##.  #####.  ..#...  ..#...  ..#...  ..#.#.  ......  "..
    "##..#.  #..##.  ##..#.  .##...  .##...  #..##.  ##..#.  #.#.#.  .###..  #..##.  ..##..  .##...  ..#...  ..##..  .#.#..  ......  "..
    "##..#.  #..##.  ##....  ...##.  .##...  #..##.  ##.#..  #####.  .###..  .####.  .##...  ..#...  ..#...  ..#...  ......  ......  "..
    "####..  .####.  ##....  .###..  ..###.  .####.  ###...  ##.##.  ##.##.  ...##.  #####.  ..##..  ..#...  .##...  ......  ......  "..
    "##....  ...##.  ......  ......  ......  ......  ......  ......  ......  .###..  ......  ......  ......  ......  ......  ......  "..
    "                                                                                                                                "..
    "                                                                                                                                ";

local C64 = 
    "000000".."574200".."40318d".."505050".."8b5429".."55a049".."883932".."787878"..
    "8b3f96".."7869c4".."9f9f9f".."94e089".."b86962".."67b6bd".."bfce72".."ffffff";

--------------------------------------------------------------------------------------------------------------------------------------------

FONT = WideFont;
PALETTE = C64;

So, you can edit system font or RGB values in any external editor you want and reload TIC to take effect. Font renderer reacts only to # character.

You can edit it directly in the file system (win: C:\Users\%user%\AppData\Roaming\TIC - tiny computer\0.16.0 dev) or by using get/add commands in the TICs console.

But remember that the assigned font and palette will appear only in your local copy of TIC, not in exported game.

Awesome! Now I would love a config app/function that I can call from within TIC to modify those (and maybe keyconfig as well?). Similar to what Pico-8 does with keyconfig.

Any plans in the future to have font/palette included as a part of the TIC cart? If I design a game in a custom palette with a custom font, I would like it for others to be able to play the way I intended it.

Developer

Not sure if there will be a separate app to edit the config file. The idea is to allow users to customize their local versions of TIC with the config file and TIC doesn't have access to edit config.lua from inside.

I'm going to add FONT (or TEXT) api function to render variety width font directly from the spritesheet, PRINT api func will be used to draw text with only system font. As for palette, you can define it when game starts by POKE or MEMCPY functions.

Could it be possible to make the last character represent TAB instead of DEL.

Moonscript is based on indentation, and I had a bug caused by having a space rather than a TAB. It was quite annoying.

If I could mark tabs with a little dot, it would prevents those kind of mistakes.

Developer

Ok, I'll add all the characters from 0-127 to the config and you can change real TAB. Pls add an issue.

Can this still be done? I'd love to edit with my own font!

i've would like to change my own palette map

Do you want to change the palette for a game, or to make your own theme for TIC-80 ?
You should get answer for both in the Palette page of the wiki: https://github.com/nesbox/TIC-80/wiki/palette