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

=====================================
Drawing a window frame
=====================================

C++ : void TCODConsole::printFrame(int x,int y,int w,int h, bool clear, TCOD_bkgnd_flag_t flag, const char *fmt, ...)
C   : void TCOD_console_print_frame(TCOD_console_t con,int x,int y,int w,int h, bool clear, TCOD_bkgnd_flag_t flag, const char *fmt, ...)
Py  : console_print_frame(con,x, y, w, h, clear, fmt)

This function calls the rect function using the TCOD_BKGND_SET flag, then draws a rectangle with the console's default foreground color. If fmt is not NULL, it is printed on the top of the rectangle, using inverted colors.
ParameterDescription
conIn the C version, the offscreen console handler or NULL for the root console.
x,yCoordinates of the rectangle upper-left corner in the console.
0 <= x < console width
0 <= y < console height
w,hSize of the rectangle in the console.
x <= x+w < console width
y <= y+h < console height
clearif true, all characters inside the rectangle are set to ASCII code 32 (space).
If false, only the background color is modified
flagControls how the frame area is filled with the currently active background colour.
fmtIf NULL, the funtion only draws a rectangle.
Else, printf-like format string, eventually followed by parameters. You can use control codes to change the colors inside the string.