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)

int TCODConsole::getWidth()

Console:getWidth()

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)

int TCODConsole::getHeight()

Console:getHeight()

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)

TCODColor TCODConsole::getBackgroundColor()

Console:getBackgroundColor()

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)

TCODColor TCODConsole::getForegroundColor()

Console:getForegroundColor()

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)

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

Console::getCharBackground(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)

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

Console::getCharForeground(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.

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

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

console_get_char(con,x,y)

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

Console::getChar(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