|
|
TCODLIB_BEGIN_IGNORE_DEPRECATIONS | Console () |
| | Default initializer.
|
| | Console (int width, int height) |
| | Create a new Console with the given size.
|
| | Console (const std::array< int, 2 > &size) |
| | Create a new Console with the given size.
|
|
| Console (const Console &other) |
| | Clone the shape and tile data of a Console.
|
| | Console (ConsolePtr ptr) |
| | Pass ownership of a ConsolePtr to a new Console.
|
| | Console (TCOD_Console *ptr) |
| | Takes ownership of a raw TCOD_Console pointer.
|
|
Console & | operator= (const Console &rhs) |
| | Copy the shape and tile data of another console.
|
|
| Console (Console &&) noexcept=default |
| | Standard move constructor.
|
|
Console & | operator= (Console &&rhs) noexcept |
| | Standard move assignment.
|
|
| ~Console () noexcept=default |
| | Standard destructor.
|
|
| operator TCOD_Console & () |
| | Allow implicit conversions to a TCOD_Console reference.
|
|
| operator const TCOD_Console & () const |
| | Allow implicit conversions to a const TCOD_Console reference.
|
|
auto | get () noexcept -> TCOD_Console * |
| | Return a pointer to the internal TCOD_Console struct.
|
|
auto | get () const noexcept -> const TCOD_Console * |
| | Return a const pointer to the internal TCOD_Console struct.
|
| auto | release () noexcept -> TCOD_Console * |
| | Release ownership of this Console's TCOD_Console* and return the pointer.
|
|
auto | begin () noexcept -> TCOD_ConsoleTile * |
| | Return a pointer to the beginning of this consoles tile data.
|
|
auto | begin () const noexcept -> const TCOD_ConsoleTile * |
| | Return a const pointer to the beginning of this consoles tile data.
|
|
auto | end () noexcept -> TCOD_ConsoleTile * |
| | Return a pointer to the end of this consoles tile data.
|
|
auto | end () const noexcept -> const TCOD_ConsoleTile * |
| | Return a const pointer to the end of this consoles tile data.
|
|
auto | get_width () const noexcept -> int |
| | Return the width of this console.
|
|
auto | get_height () const noexcept -> int |
| | Return the height of this console.
|
| auto | get_shape () const noexcept -> std::array< int, 2 > |
| | Return the {width, height} shape of this console as a std::array<int, 2>.
|
| void | clear (const TCOD_ConsoleTile &tile={0x20, {255, 255, 255, 255}, {0, 0, 0, 255}}) noexcept |
| | Clear a console by setting all tiles to the provided TCOD_ConsoleTile object.
|
|
auto | operator[] (const std::array< int, 2 > &xy) noexcept -> TCOD_ConsoleTile & |
| | Return a reference to the tile at xy.
|
|
auto | operator[] (const std::array< int, 2 > &xy) const noexcept -> const TCOD_ConsoleTile & |
| | Return a constant reference to the tile at xy.
|
| auto | at (const std::array< int, 2 > &xy) -> TCOD_ConsoleTile & |
| | Return a reference to the tile at xy.
|
| auto | at (const std::array< int, 2 > &xy) const -> const TCOD_ConsoleTile & |
| | Return a constant reference to the tile at xy.
|
| auto | at (int x, int y) -> TCOD_ConsoleTile & |
| | Return a reference to the tile at x,y.
|
| auto | at (int x, int y) const -> const TCOD_ConsoleTile & |
| | Return a constant reference to the tile at x,y.
|
|
bool | in_bounds (const std::array< int, 2 > &xy) const noexcept |
| | Return true if xy are within the bounds of this console.
|
A managed libtcod console containing a grid of tiles with {ch, fg, bg} information.
Note that all tile references are to TCOD_ConsoleTile structs and will include an alpha channel.
console.
at({1, 1}).ch =
'@';
console[{1, 1}].bg = {0, 0, 255, 255};
if (console.in_bounds({100, 100})) {}
for (auto& tile : console) tile.fg = {255, 255, 0, 255};
for (auto& tile : console) tile = {0x20, {255, 255, 255, 255}, {0, 0, 0, 255}};
for (int y = 0; y < console.get_height(); ++y) {
for (int x = 0; x < console.get_width(); ++x) {
auto& tile = console.at({x, y});
}
}
A managed libtcod console containing a grid of tiles with {ch, fg, bg} information.
Definition console_types.hpp:80
auto at(const std::array< int, 2 > &xy) -> TCOD_ConsoleTile &
Return a reference to the tile at xy.
Definition console_types.hpp:246
embed:rst:leading-asterisk
.. versionadded:: 1.19