|
libtcod
|
Classes | |
| class | TCODConsole |
| Classic turn by turn game loop:TCODConsole::initRoot(80,50,"my game",false); while (!endGame && !TCODConsole::isWindowClosed()) { ... draw on TCODConsole::root TCODConsole::flush(); TCOD_key_t key; TCODConsole::waitForEvent(TCOD_EVENT_KEY_PRESS,&key,NULL,true); ... update world, using key }. More... | |
Functions | |
| void | tcod::blit (TCOD_Console &dest, const TCOD_Console &source, const std::array< int, 2 > &dest_xy={0, 0}, std::array< int, 4 > source_rect={0, 0, 0, 0}, float foreground_alpha=1.0f, float background_alpha=1.0f) |
| Blit a region of tiles from one console to another. | |
| void | tcod::draw_rect (TCOD_Console &console, const std::array< int, 4 > &rect, int ch, std::optional< TCOD_ColorRGB > fg, std::optional< TCOD_ColorRGB > bg, TCOD_bkgnd_flag_t flag=TCOD_BKGND_SET) |
| Fill a region with the given graphic. | |
| void | tcod::draw_frame (TCOD_Console &console, const std::array< int, 4 > &rect, const std::array< int, 9 > &decoration, std::optional< TCOD_ColorRGB > fg, std::optional< TCOD_ColorRGB > bg, TCOD_bkgnd_flag_t flag=TCOD_BKGND_SET, bool clear=true) |
| Draw a decorative frame. | |
| std::vector< tcod::ConsolePtr > | tcod::load_xp (const std::filesystem::path &path) |
| Load an array of consoles from a REXPaint file. | |
| void | tcod::save_xp (const std::vector< const TCOD_Console * > &consoles, const std::filesystem::path &path, int compress_level=9) |
| Save an array of consoles to a REXPaint file. | |
|
inline |
Blit a region of tiles from one console to another.
| dest | The destination console. |
| source | The source console to blit from. |
| dest_xy | The upper-left position of the destination console to blit to. |
| source_rect | The source region {left, top, width, height} to blit from. A width or height of zero will use the entire console. |
| foreground_alpha | |
| background_alpha |
|
inline |
Draw a decorative frame.
| console | A reference to a TCOD_Console. |
| rect | An {x, y, width, height} rectangle, starting from the upper-left-most tile as zero. |
| decoration | The codepoints to use for the frame in row-major order. |
| fg | The foreground color. The printed text is set to this color. If std::nullopt then the foreground will be left unchanged, inheriting the previous value of the tile. |
| bg | The background color. The background tile under the printed text is set to this color. If std::nullopt then the background will be left unchanged. |
| flag | The background blending flag. |
| clear | If true then the center area will be cleared with the center decoration. |
decoration is given the codepoints to be used for the edges, corners, and fill of the frame in this order:
0 1 2 3 4 5 6 7 8
embed:rst:leading-asterisk .. versionadded:: 1.19
|
inline |
Fill a region with the given graphic.
| console | A reference to a TCOD_Console. |
| rect | An {x, y, width, height} rectangle, starting from the upper-left-most tile as zero. |
| ch | The character to draw. If zero then the characters in the drawing region will not be changed. |
| fg | The foreground color. The printed text is set to this color. If std::nullopt then the foreground will be left unchanged, inheriting the previous value of the tile. |
| bg | The background color. The background tile under the printed text is set to this color. If std::nullopt then the background will be left unchanged. |
| flag | The background blending flag. |
embed:rst:leading-asterisk .. versionadded:: 1.19
|
inline |
Load an array of consoles from a REXPaint file.
| path | The path to the REXPaint file to load. |
embed:rst:leading-asterisk .. versionadded:: 1.18
|
inline |
Save an array of consoles to a REXPaint file.
| consoles | A vector of consoles to save. |
| path | The path to write the REXPaint file to. |
| compress_level | A compression level for the zlib library. |
embed:rst:leading-asterisk .. versionadded:: 1.18