libtcoddocumentation

2.2.5. Reading the content of the console

Get the console's width

This function returns the width of a console (either the root console or an offscreen console)

int TCODConsole::getWidth() const

int TCOD_console_get_width(TCOD_console_t con)

console_get_width(con)

ParameterDescription
conin the C and Python versions, the offscreen console handler or NULL for the root console

Get the console's height

This function returns the height of a console (either the root console or an offscreen console)

int TCODConsole::getHeight() const

int TCOD_console_get_height(TCOD_console_t con)

console_get_height(con)

ParameterDescription
conin the C and Python versions, the offscreen console handler or NULL for the root console

Reading the default background color

This function returns the default background color of a console.

TCODColor TCODConsole::getDefaultBackground() const

TCOD_color_t TCOD_console_get_default_background(TCOD_console_t con)

console_get_default_background(con)

ParameterDescription
conin the C and Python versions, the offscreen console handler or NULL for the root console

Reading the default foreground color

This function returns the default foreground color of a console.

TCODColor TCODConsole::getDefaultForeground() const

TCOD_color_t TCOD_console_get_default_foreground(TCOD_console_t con)

console_get_default_foreground(con)

ParameterDescription
conin the C and Python versions, the offscreen console handler or NULL for the root console

Reading the background color of a cell

This function returns the background color of a cell.

TCODColor TCODConsole::getCharBackground(int x, int y) const

TCOD_color_t TCOD_console_get_char_background(TCOD_console_t con,int x, int y)

console_get_char_background(con,x,y)

ParameterDescription
conin the C and Python versions, 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

Reading the foreground color of a cell

This function returns the foreground color of a cell.

TCODColor TCODConsole::getCharForeground(int x, int y) const

TCOD_color_t TCOD_console_get_char_foreground(TCOD_console_t con,int x, int y)

console_get_char_foreground(con,x,y)

ParameterDescription
conin the C and Python versions, 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

Reading the ASCII code of a cell

This function returns the ASCII code of a cell.

int TCODConsole::getChar(int x, int y) const

int TCOD_console_get_char(TCOD_console_t con,int x, int y)

console_get_char(con,x,y)

ParameterDescription
conin the C and Python versions, 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