libtcod
Loading...
Searching...
No Matches
tcod::Tileset Class Reference

A C++ Tileset container. More...

#include <tileset.hpp>

Public Member Functions

 Tileset ()=default
 Construct a new Tileset object.
 Tileset (int tile_width, int tile_height)
 Construct a new Tileset object with tiles of the given size.
 Tileset (const std::array< int, 2 > &tile_shape)
 Construct a new Tileset object with tiles of the given size.
 Tileset (TilesetPtr ptr)
 Pass ownership of a TilesetPtr to a new Tileset.
 Tileset (TCOD_Tileset *ptr)
 Takes ownership of a raw TCOD_Tileset pointer.
auto get_tile_width () const noexcept -> int
 Get the width of tiles in this Tileset.
auto get_tile_height () const noexcept -> int
 Get the height of tiles in this Tileset.
auto get_tile_shape () const noexcept -> std::array< int, 2 >
 Get the {width, height} shape of tiles in this Tileset.
auto get () noexcept -> TCOD_Tileset *
 Return a non-owning pointer to this objects TCOD_Tileset.
auto get () const noexcept -> TCOD_Tileset *
 Return a non-owning pointer to this objects TCOD_Tileset.
auto release () noexcept -> TCOD_Tileset *
 Release ownership of this Tileset's TCOD_Tileset* and return the pointer.
 operator TCOD_Tileset & ()
 Allow implicit conversions to a TCOD_Console reference.
 operator const TCOD_Tileset & () const
 Allow implicit conversions to a const TCOD_Console reference.

Detailed Description

A C++ Tileset container.

embed:rst:leading-asterisk 
.. versionadded:: 1.19

Constructor & Destructor Documentation

◆ Tileset() [1/4]

tcod::Tileset::Tileset ( int tile_width,
int tile_height )
inlineexplicit

Construct a new Tileset object with tiles of the given size.

The tileset will be empty.

Parameters
tile_widthThe width of the tiles of this object in pixels.
tile_heightThe width of the tiles of this object in pixels.

◆ Tileset() [2/4]

tcod::Tileset::Tileset ( const std::array< int, 2 > & tile_shape)
inlineexplicit

Construct a new Tileset object with tiles of the given size.

The tileset will be empty.

Parameters
tile_shapeThe {width, height} of the tiles in pixels.

◆ Tileset() [3/4]

tcod::Tileset::Tileset ( TilesetPtr ptr)
inlineexplicit

Pass ownership of a TilesetPtr to a new Tileset.

Parameters
ptrA tcod::TilesetPtr, must not be nullptr.

◆ Tileset() [4/4]

tcod::Tileset::Tileset ( TCOD_Tileset * ptr)
inlineexplicit

Takes ownership of a raw TCOD_Tileset pointer.

Parameters
ptrA pointer which will now be managed by this object.

Member Function Documentation

◆ get() [1/2]

auto tcod::Tileset::get ( ) const->TCOD_Tileset *
inlinenodiscardnoexcept

Return a non-owning pointer to this objects TCOD_Tileset.

Returns
TCOD_Tileset

◆ get() [2/2]

auto tcod::Tileset::get ( ) ->TCOD_Tileset *
inlinenodiscardnoexcept

Return a non-owning pointer to this objects TCOD_Tileset.

Returns
TCOD_Tileset

◆ get_tile_height()

auto tcod::Tileset::get_tile_height ( ) const->int
inlinenodiscardnoexcept

Get the height of tiles in this Tileset.

Returns
int The total height of tiles in pixels.

◆ get_tile_shape()

auto tcod::Tileset::get_tile_shape ( ) const->std::array< int, 2 >
inlinenodiscardnoexcept

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.

◆ get_tile_width()

auto tcod::Tileset::get_tile_width ( ) const->int
inlinenodiscardnoexcept

Get the width of tiles in this Tileset.

Returns
int The total width of tiles in pixels.

◆ release()

auto tcod::Tileset::release ( ) ->TCOD_Tileset *
inlinenoexcept

Release ownership of this Tileset's TCOD_Tileset* and return the pointer.

Using this Tileset afterwards is undefined.


The documentation for this class was generated from the following file:
  • C:/Users/4b796/Projects/libtcod/src/libtcod/tileset.hpp