tcod-base supports the use of a single tileset, which can be created either from a .ttf or .otf font file or a .png tilesheet.
See python-tcod's documentation for details: tcod.tileset
If necessary, add a new font or tilesheet to the relevant assets directory.
Fonts are stored in /assets/fonts. Tilesheets are stored in /assets/tilesheets.
In constants.py:
- Set the
TILE_SOURCEto eitherfontortilesheet.
TILE_SOURCE = "font"
or
TILE_SOURCE = "tilesheet"
- Modify the default font or tilesheet values.
The default font values, which may need modifying, are:
FONT = "DejaVuSansMono.ttf"
FONT_WIDTH = 20
FONT_HEIGHT = 20
See python-tcod's documentation for details: tcod.tileset.load_tilesheet
The default tilesheet values, which may need modifying, are:
TILESHEET = "terminal16x16_gs_ro.png"
TILESHEET_CHAR_MAP = tcod.tileset.CHARMAP_CP437
TILESHEET_COLUMNS = 16
TILESHEET_ROWS = 16
See python-tcod's documentation for details: tcod.tileset.load_truetype_font
The tileset is initialised during the InitState.
-
GameManager.__init__()(game_manager.py) sets the state toInitState -
InitState.__init__()(init_state.py) callstile_manager.__init__() -
tile_manager.__init__()(tile_manager.py) callstile_manager.load_tileset() -
tile_manager.load_tileset()loads the tileset using either a font or tilesheet (as defined by theTILE_SOURCEvalue)