Template Function tcod::load_tilesheet¶
Defined in File tileset.hpp
Function Documentation¶
-
template<typename ArrayType>
inline 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.
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.
New in version 1.19.
- Template Parameters
ArrayType – Must be a
std::vector
orstd::array
like type. Withsize()
anddata()
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
ortcod::CHARMAP_TCOD
are typical values for this argument.
- Returns
TilesetPtr A unique pointer to a
TCOD_Tileset
.