Class Tileset¶
Defined in File tileset.hpp
Class Documentation¶
-
class Tileset
A C++ Tileset container.
New in version 1.19.
Public Functions
-
Tileset() = default
Construct a new Tileset object.
-
inline explicit Tileset(int tile_width, int tile_height)
Construct a new Tileset object with tiles of the given size.
The tileset will be empty.
- Parameters
tile_width – The width of the tiles of this object in pixels.
tile_height – The width of the tiles of this object in pixels.
-
inline explicit Tileset(const std::array<int, 2> &tile_shape)
Construct a new Tileset object with tiles of the given size.
The tileset will be empty.
- Parameters
tile_shape – The
{width, height}
of the tiles in pixels.
-
inline explicit Tileset(TilesetPtr ptr)
Pass ownership of a TilesetPtr to a new Tileset.
- Parameters
ptr – A
tcod::TilesetPtr
, must not be nullptr.
-
inline explicit Tileset(TCOD_Tileset *ptr)
Takes ownership of a raw TCOD_Tileset pointer.
- Parameters
ptr – A pointer which will now be managed by this object.
-
inline auto get_tile_width() const noexcept -> int
Get the width of tiles in this Tileset.
- Returns
int The total width of tiles in pixels.
-
inline auto get_tile_height() const noexcept -> int
Get the height of tiles in this Tileset.
- Returns
int The total height of tiles in pixels.
-
inline auto get_tile_shape() const noexcept -> std::array<int, 2>
Get the
{width, height}
shape of tiles in this Tileset.- Returns
std::array<int, 2> The
{width, height}
of tiles in this Tileset in pixels.
-
inline auto get() noexcept -> TCOD_Tileset*
Return a non-owning pointer to this objects TCOD_Tileset.
- Returns
-
inline auto get() const noexcept -> TCOD_Tileset*
Return a non-owning pointer to this objects TCOD_Tileset.
- Returns
-
inline auto release() noexcept -> TCOD_Tileset*
Release ownership of this Tileset’s
TCOD_Tileset*
and return the pointer.Using this Tileset afterwards is undefined.
-
inline operator TCOD_Tileset&()
Allow implicit conversions to a TCOD_Console reference.
-
inline operator const TCOD_Tileset&() const
Allow implicit conversions to a const TCOD_Console reference.
-
Tileset() = default