Skip to content

Latest commit

 

History

History
274 lines (209 loc) · 8.8 KB

console.rst

File metadata and controls

274 lines (209 loc) · 8.8 KB

Console

tcod::Console

tcod::Console

TCOD_Console

TCOD_Console

ConsolePtr

TCOD_ConsoleTile

Initializing the console

Creating the game window

TCOD_renderer_t

TCOD_console_init_root

TCOD_quit

Using a custom bitmap font

TCOD_font_flags_t

TCOD_console_set_custom_font

Using custom characters mapping

TCOD_console_map_ascii_code_to_font

TCOD_console_map_ascii_codes_to_font

TCOD_console_map_string_to_font

Fullscreen mode

TCOD_console_set_fullscreen

TCOD_console_is_fullscreen

Communicate with the window manager

TCOD_console_is_active

TCOD_console_has_mouse_focus

TCOD_console_is_window_closed

TCOD_console_set_window_title

libtcod's Credits

TCOD_console_credits

TCOD_console_credits_reset

TCOD_console_credits_render

TCOD_console_credits_render_ex

Drawing on the console

Basic drawing functions

TCOD_console_set_default_foreground

TCOD_console_set_default_background

TCOD_console_set_background_flag

TCOD_console_clear

TCOD_console_put_char

TCOD_console_put_char_ex

TCOD_console_set_char

TCOD_console_set_char_foreground

TCOD_console_set_char_background

TCOD_console_rect

TCOD_console_draw_rect_rgb

TCOD_console_draw_frame_rgb

TCOD_console_hline

TCOD_console_vline

Drawing functions (C++)

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)

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)

Background effect flags

TCOD_bkgnd_flag_t

String printing alignment

TCOD_alignment_t

TCOD_console_set_alignment

TCOD_console_get_alignment

Reading the content of the console

TCOD_console_get_width

TCOD_console_get_height

TCOD_console_get_char

TCOD_console_get_char_foreground

TCOD_console_get_char_background

TCOD_console_get_default_foreground

TCOD_console_get_default_background

TCOD_console_get_background_flag

Screen fading functions

TCOD_console_set_fade

TCOD_console_get_fade

TCOD_console_get_fading_color

ASCII constants

TCOD_chars_t

Printing to the console

Printing functions using UTF-8

TCOD_console_printf

TCOD_console_printf_ex

TCOD_console_printf_rect

TCOD_console_printf_rect_ex

TCOD_console_get_height_rect_fmt

TCOD_console_printf_frame

TCOD_console_printn

TCOD_console_printn_rect

TCOD_console_vprintf

TCOD_console_vprintf_rect

TCOD_console_get_height_rect_n

TCOD_console_get_height_rect_wn

Printing functions using UTF-8 (C++)

tcod::print(TCOD_Console& console, const std::array<int, 2>& xy, std::string_view str, std::optional<TCOD_ColorRGB> fg, std::optional<TCOD_ColorRGB> bg, TCOD_alignment_t alignment = TCOD_LEFT, TCOD_bkgnd_flag_t flag = TCOD_BKGND_SET)

tcod::print_rect(TCOD_Console& console, const std::array<int, 4>& rect, std::string_view str, std::optional<TCOD_ColorRGB> fg, std::optional<TCOD_ColorRGB> bg, TCOD_alignment_t alignment = TCOD_LEFT, TCOD_bkgnd_flag_t flag = TCOD_BKGND_SET)

tcod::get_height_rect(int width, std::string_view str)

tcod::stringf

Printing functions using 8-bit encodings (deprecated)

Note

These functions use EASCII encoded strings which are not compatible with Unicode. They are deprecated for this reason.

PrintEASCII

Printing functions using wchar_t (deprecated)

Note

These functions say they are UTF, however they will behave as UCS2 or UCS4 depending on the platform. They are deprecated for this reason.

PrintWide

Flushing the root console

TCOD_console_flush

TCOD_sys_accumulate_console

Handling user input

Blocking user input

TCOD_console_wait_for_keypress

TCOD_sys_wait_for_event

Non blocking user input

TCOD_console_check_for_keypress

TCOD_console_is_key_pressed

TCOD_sys_check_for_event

TCOD_mouse_get_status

Keyboard event structure

TCOD_key_status_t

TCOD_key_t

Key codes

TCOD_keycode_t

Mouse event structure

TCOD_mouse_t

Events from SDL2

tcod::sdl2::process_event(const union SDL_Event &in, TCOD_key_t &out) noexcept

tcod::sdl2::process_event(const union SDL_Event &in, TCOD_mouse_t &out) noexcept

TCOD_sys_process_key_event

TCOD_sys_process_mouse_event

Using off-screen consoles

Creating and deleting off-screen consoles

TCOD_console_new

TCOD_console_delete

Creating an off-screen console from any .asc/.apf/.xp file

TCOD_console_from_file

Loading an offscreen console from a .asc file

TCOD_console_load_asc

Loading an offscreen console from a .apf file

TCOD_console_load_apf

Saving a console to a .asc file

TCOD_console_save_asc

Saving a console to a .apf file

TCOD_console_save_apf

Working with REXPaint .xp files

REXPaint gives special treatment to tiles with a magic pink {255, 0, 255} background color. You can processes this effect manually or by setting TCOD_console_set_key_color to TCOD_fuchsia.

TCOD_console_from_xp

TCOD_console_load_xp

TCOD_console_save_xp

TCOD_console_list_from_xp

TCOD_console_list_save_xp

Blitting a console on another one

TCOD_console_blit

Define a blit-transparent color

TCOD_console_set_key_color