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

=====================================
Modifying every property of a cell
=====================================

TCODConsole::putChar

C++ : void TCODConsole::putChar(int x, int y, int c, TCOD_bkgnd_flag_t flag = TCOD_BKGND_SET)
C   : void TCOD_console_put_char(TCOD_console_t con,int x, int y, int c, TCOD_bkgnd_flag_t flag)
Py  : console_put_char( con, x,  y, c, flag)

This function modifies every property of a cell :
- update the cell's background color according to the console default background color (see TCOD_bkgnd_flag_t).
- set the cell's foreground color to the console default foreground color
- set the cell's ASCII code to c
ParameterDescription
conIn the C version, the offscreen console handler or NULL for the root console.
x,yCoordinates of the cell in the console.
0 <= x < console width
0 <= y < console height
cThe new ASCII code for the cell between 0 and 255. You can use ASCII constants.
flagThis flag defines how the cell's background color is modified. See TCOD_bkgnd_flag_t.

TCODConsole::putCharEx

C++ : void TCODConsole::putCharEx(int x, int y, int c, const TCODColor & fore, const TCODColor & back)
C   : void TCOD_console_put_char_ex(TCOD_console_t con,int x, int y, int c, TCOD_color_t fore, TCOD_color_t back)
Py  : console_put_char_ex( con, x,  y, c, fore, back)

This function modifies every property of a cell :
- set the cell's background color to back.
- set the cell's foreground color to fore.
- set the cell's ASCII code to c.
ParameterDescription
conIn the C version, the offscreen console handler or NULL for the root console.
x,yCoordinates of the cell in the console.
0 <= x < console width
0 <= y < console height
cThe new ASCII code for the cell between 0 and 255. You can use ASCII constants.
fore,backNew foreground and background color for this cell.