Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

TIC-80

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

Change color of custom font

A topic by mrbob created Sep 24, 2017 Views: 1,169 Replies: 5
Viewing posts 1 to 6

Hi,

There is any way to change a color (at runtime) for custom font in "font" function (like color parameter in print function)?


Thanks!

At the moment there is no such functionality.

I have seen that it is possible to do, changing values in the memory with poke, but it's too "complex" for my need.

Maybe future versions can have the "color" parameter on font function (or something like pal function of pico-8).

As a veteran programmer who half the lifetime practised coding in BASIC and experimenting with writing games for nearly 40 years, I have worked with "poke" and "peek" years ago.  But I warn you - manipulating bits to do custom font work with poke in font memory is tricky!  The manipulated bits in the data bytes to assign to the TIC-80 memory addresses starting at 14604 in hexadecimal works the 8 binary digits in a byte from  left to right: bit 1 is on the left and bit 7 is on the right.

(-1)

Using the palette swapping function here you can change the color value of an index to another one. So you can do it pretty easily. :)

Or you could use the Pal function to change the  Color of a single palette slot.

https://github.com/nesbox/TIC-80/wiki/code-examples-and-snippets#pal-function