Tileset loading and handling functions.
More...
|
| template<typename ArrayType> |
| auto | tcod::load_tilesheet (const std::filesystem::path &path, const std::array< int, 2 > &columns_rows, const ArrayType &charmap) -> Tileset |
| | Load a tilesheet from a PNG file.
|
| auto | tcod::load_bdf (const std::filesystem::path &path) -> TilesetPtr |
| | Load a Tileset from a BDF font file.
|
Tileset loading and handling functions.
◆ TilesetPtr
A unique pointer to a TCOD_Tileset.
embed:rst:leading-asterisk
.. versionadded:: 1.19
◆ load_bdf()
| auto tcod::load_bdf |
( |
const std::filesystem::path & | path | ) |
->TilesetPtr |
|
inline |
Load a Tileset from a BDF font file.
Will throw an exception on a missing or corrupt file.
embed:rst:leading-asterisk
.. versionadded:: 1.19
◆ load_tilesheet()
template<typename ArrayType>
| auto tcod::load_tilesheet |
( |
const std::filesystem::path & | path, |
|
|
const std::array< int, 2 > & | columns_rows, |
|
|
const ArrayType & | charmap )->Tileset |
|
inline |
Load a tilesheet from a PNG file.
An exception will be thrown if the file is missing or corrupt.
Tiles are indexed in row-major order and should be assigned to Unicode codepoints.
embed:rst:leading-asterisk
.. versionadded:: 1.19
- Template Parameters
-
| ArrayType | Must be a std::vector or std::array like type. With size() and data() methods. |
- Parameters
-
| path | The file path to the PNG tilesheet image. |
| columns_rows | The shape of the grid on the tileset as {columns, rows}. |
| charmap | An array of characters where charmap[tile_index] = codepoint. tcod::CHARMAP_CP437 or tcod::CHARMAP_TCOD are typical values for this argument. |
- Returns
- TilesetPtr A unique pointer to a TCOD_Tileset.