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

=====================================
Filling a rectangle with the background color
=====================================

C++ : void TCODConsole::rect(int x, int y, int w, int h, bool clear, TCOD_bkgnd_flag_t flag = TCOD_BKGND_SET)
C   : void TCOD_console_rect(TCOD_console_t con,int x, int y, int w, int h, bool clear, TCOD_bkgnd_flag_t flag)
Py  : console_rect(con,x,  y,  w, h, clear, flag)

Defines a rectangle inside a console. For each cell in the rectangle :
- set the cell's background color to the console default background color
- if clear is true, set the cell's ASCII code to 32 (space)
ParameterDescription
conIn the C version, the offscreen console handler or NULL for the root console.
x,yCoordinates of 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
flagThis flag defines how the cell's background color is modified. See TCOD_bkgnd_flag_t.
insert a comment