< index
< 2. Console emulator
< 2.2 Drawing on the root console

=====================================
Printing a right aligned string
=====================================

C++ : void TCODConsole::printRight(int x, int y, TCOD_bkgnd_flag_t flag, const char *fmt, ...)
C   : void TCOD_console_print_right(TCOD_console_t con,int x, int y, TCOD_bkgnd_flag_t flag, const char *fmt, ...)
Py  : console_print_right(con,x, y, flag, fmt)

This function draws a right aligned string on the console, using default foreground and background colors. If the string reaches the left border of the console, it is truncated.
ParameterDescription
conIn the C version, the offscreen console handler or NULL for the root console.
x,yCoordinates of the string's last character in the console.
0 <= x < console width
0 <= y < console height
flagThis flag defines how the cell's background color is modified. See TCOD_bkgnd_flag_t.
fmtprintf-like format string, eventually followed by parameters. You can use control codes to change the colors inside the string.
insert a comment