2012
06.13

This is still experimental and comes from the old aborted 1.5.0 code base.

When loading a font, the library now scans the characters pixels to detect if a character is monochrome (contains only values of gray) or multicolored.

Multi-colored characters use a different (slightly slower) renderer. This renderer uses the color from the font and multiply it with the foreground color.

You can see this in the C++ samples when using the terminal.png font : the first and last rows of the “True color” sample uses a multi-colored character :

This opens possibilities for more graphical roguelikes using libtcod as any console cell can now contain a small tile. Note that you still can’t draw text on top of a tile since a console cell can only contain a single ascii code. If you want text on top of tiles, you still need to use the SDL callback. Check the tile engine demo.

2 comments so far

Add Your Comment
  1. Awesome! I gotta try this, I still have some cool tiles lying around and always wondered how the tutorial game would look with them 🙂

    Meanwhile, can you give a bit more detail on what exactly happens to the tile in this mode? I get that the image is multiplied by the foreground color, but does the background color have any influence at all? If so, is this controlled by PNG alpha or some other way?

  2. Well it seems you found out by yourself but in case someone read this, It works exactly like a font character except the font color is taken into account. The final pixel color is :
    (1-alpha) * background color + alpha * (font color * foreground color)