#include <console.h>
Public Member Functions | |
Console () | |
~Console () | |
void | clearConsole (int bgcolor) |
void | clearArea (int startX, int startY, int rows, int cols, int bgcolor) |
void | moveCursor (int row, int column) |
void | backspace () |
void | setColor (int fgcolor, int bgcolor) |
void | drawString (int x, int y, int color, int bgcolor, const char *msg) |
void | centerString (int y, int color, int bgcolor, const char *msg) |
void | drawWindow (int startX, int startY, int rows, int cols, int bgColor, int title_textColor, int title_textlineColor, int title_bgColor, int shadowColor, int declColor, const char *windowTitle) |
void | clearConsole () |
void | clearConsoleArea (int startX, int startY, int rows, int cols) |
void | clearPrimaryArea (int startX, int startY, int rows, int cols) |
void | clearSecondaryArea (int startX, int startY, int rows, int cols) |
void | drawStringPrimary (int x, int y, const char *msg) |
void | drawStringPrimaryAlternate (int x, int y, const char *msg) |
void | drawStringSecondary (int x, int y, const char *msg) |
void | drawStringSecondaryAlternate (int x, int y, const char *msg) |
void | centerStringPrimary (int y, const char *msg) |
void | centerStringPrimaryAlternate (int y, const char *msg) |
void | centerStringSecondary (int y, const char *msg) |
void | centerStringSecondaryAlternate (int y, const char *msg) |
void | drawPrimaryWindow (int startX, int startY, int rows, int cols, const char *windowTitle) |
void | drawSecondaryWindow (int startX, int startY, int rows, int cols, const char *windowTitle) |
void | registerSkin (Skin skin) |
Static Public Attributes | |
static const int | BLACK = 0 |
static const int | DARK_RED = 1 |
static const int | DARK_GREEN = 2 |
static const int | DARK_YELLOW = 3 |
static const int | DARK_BLUE = 4 |
static const int | DARK_MAGENTA = 5 |
static const int | DARK_CYAN = 6 |
static const int | GRAY = 7 |
static const int | DARK_GRAY = 10 |
static const int | RED = 11 |
static const int | GREEN = 12 |
static const int | YELLOW = 13 |
static const int | BLUE = 14 |
static const int | MAGENTA = 15 |
static const int | CYAN = 16 |
static const int | WHITE = 17 |
Definition at line 13 of file console.h.
Console::Console | ( | ) |
Constructor
Definition at line 22 of file console.cpp.
Console::~Console | ( | ) |
destructor
Definition at line 31 of file console.cpp.
void Console::backspace | ( | ) |
prints a backspace character
Definition at line 116 of file console.cpp.
void Console::centerString | ( | int | y, | |
int | color, | |||
int | bgcolor, | |||
const char * | msg | |||
) |
Draws a text string with the center of the screen at a given Y position in the provided color and intensity
[in] | y | The Y position at which to draw the text (rows) |
[in] | color | The colour to set the text background to. |
[in] | bgcolor | The colour to set the text background to. |
[in] | msg | Message which to draw onto the screen |
Definition at line 194 of file console.cpp.
void Console::centerStringPrimary | ( | int | y, | |
const char * | msg | |||
) |
Draws a text string with the center of the screen at a given Y position using the main text colour from the primary window
[in] | y | The Y position at which to draw the text (rows) |
[in] | msg | Message which to draw onto the screen |
Definition at line 479 of file console.cpp.
void Console::centerStringPrimaryAlternate | ( | int | y, | |
const char * | msg | |||
) |
Draws a text string with the center of the screen at a given Y position using the alternate text colour from the primary window
[in] | y | The Y position at which to draw the text (rows) |
[in] | msg | Message which to draw onto the screen |
Definition at line 492 of file console.cpp.
void Console::centerStringSecondary | ( | int | y, | |
const char * | msg | |||
) |
Draws a text string with the center of the screen at a given Y position using the main text colour from the primary window
[in] | y | The Y position at which to draw the text (rows) |
[in] | msg | Message which to draw onto the screen |
Definition at line 505 of file console.cpp.
void Console::centerStringSecondaryAlternate | ( | int | y, | |
const char * | msg | |||
) |
Draws a text string with the center of the screen at a given Y position using the alternate text colour from the primary window
[in] | y | The Y position at which to draw the text (rows) |
[in] | msg | Message which to draw onto the screen |
Definition at line 518 of file console.cpp.
void Console::clearArea | ( | int | startX, | |
int | startY, | |||
int | rows, | |||
int | cols, | |||
int | bgcolor | |||
) |
Clears a specific area of the screen with the provided colour used (to prevent tearing) when constantly updating a screen
[in] | startX | Starting X (cols) position of area to clear |
[in] | startY | Starting Y (rows) position of area to clear |
[in] | rows | The number of rows to clear (Y) |
[in] | cols | The number of columns to clear (X) |
[in] | bgcolor | The colour to clear the area with |
Definition at line 98 of file console.cpp.
void Console::clearConsole | ( | ) |
Clears the console setting the background with the specified colour
[in] | skin | skin to use to determine clearing colour! |
Definition at line 358 of file console.cpp.
void Console::clearConsole | ( | int | bgcolor | ) |
Clears the console setting the background with the specified colour
[in] | color | to clear console with |
Definition at line 73 of file console.cpp.
void Console::clearConsoleArea | ( | int | startX, | |
int | startY, | |||
int | rows, | |||
int | cols | |||
) |
Clears a specific area of the screen with the console colour from the provided skin. Used (to prevent tearing) when constantly updating a screen
[in] | startX | Starting X (cols) position of area to clear |
[in] | startY | Starting Y (rows) position of area to clear |
[in] | rows | The number of rows to clear (Y) |
[in] | cols | The number of columns to clear (X) |
Definition at line 375 of file console.cpp.
void Console::clearPrimaryArea | ( | int | startX, | |
int | startY, | |||
int | rows, | |||
int | cols | |||
) |
Clears a specific area of the screen with the primary window colour from the provided skin. Used (to prevent tearing) when constantly updating a screen
[in] | startX | Starting X (cols) position of area to clear |
[in] | startY | Starting Y (rows) position of area to clear |
[in] | rows | The number of rows to clear (Y) |
[in] | cols | The number of columns to clear (X) |
Definition at line 392 of file console.cpp.
void Console::clearSecondaryArea | ( | int | startX, | |
int | startY, | |||
int | rows, | |||
int | cols | |||
) |
Clears a specific area of the screen with the secondary window colour from the provided skin. Used (to prevent tearing) when constantly updating a screen
[in] | startX | Starting X (cols) position of area to clear |
[in] | startY | Starting Y (rows) position of area to clear |
[in] | rows | The number of rows to clear (Y) |
[in] | cols | The number of columns to clear (X) |
Definition at line 409 of file console.cpp.
void Console::drawPrimaryWindow | ( | int | startX, | |
int | startY, | |||
int | rows, | |||
int | cols, | |||
const char * | windowTitle | |||
) |
Draws a console based window using skin (primary colours)
[in] | startX | starting X (cols) position of the window |
[in] | startY | starting Y (rows) position of the window |
[in] | rows | height of the window (rows) |
[in] | cols | width of the window (cols) |
[in] | skin | skin object used for window drawing |
[in] | windowTitle | Name of the window to display in the title |
Definition at line 316 of file console.cpp.
void Console::drawSecondaryWindow | ( | int | startX, | |
int | startY, | |||
int | rows, | |||
int | cols, | |||
const char * | windowTitle | |||
) |
Draws a console based window using skin (secondary colours)
[in] | startX | starting X (cols) position of the window |
[in] | startY | starting Y (rows) position of the window |
[in] | rows | height of the window (rows) |
[in] | cols | width of the window (cols) |
[in] | skin | skin object used for window drawing |
[in] | windowTitle | Name of the window to display in the title |
Definition at line 339 of file console.cpp.
void Console::drawString | ( | int | x, | |
int | y, | |||
int | color, | |||
int | bgcolor, | |||
const char * | msg | |||
) |
Draws a text string at a given position in the provided color and intensity
[in] | x | The X position at which to draw the text (cols) |
[in] | y | The Y position at which to draw the text (rows) |
[in] | color | The colour to set the text background to. |
[in] | bgcolor | The colour to set the text background to. |
[in] | msg | Message which to draw onto the screen |
Definition at line 177 of file console.cpp.
void Console::drawStringPrimary | ( | int | x, | |
int | y, | |||
const char * | msg | |||
) |
Draws a text string at a given position using colours from the provided skin using the main text colour from the primary window
[in] | x | The X position at which to draw the text (cols) |
[in] | y | The Y position at which to draw the text (rows) |
[in] | msg | Message which to draw onto the screen |
Definition at line 424 of file console.cpp.
void Console::drawStringPrimaryAlternate | ( | int | x, | |
int | y, | |||
const char * | msg | |||
) |
Draws a text string at a given position using colours from the provided skin using the alternate text colour from the primary window
[in] | x | The X position at which to draw the text (cols) |
[in] | y | The Y position at which to draw the text (rows) |
[in] | msg | Message which to draw onto the screen |
Definition at line 438 of file console.cpp.
void Console::drawStringSecondary | ( | int | x, | |
int | y, | |||
const char * | msg | |||
) |
Draws a text string at a given position using colours from the provided skin using the main text colour from the secondary window
[in] | x | The X position at which to draw the text (cols) |
[in] | y | The Y position at which to draw the text (rows) |
[in] | msg | Message which to draw onto the screen |
Definition at line 452 of file console.cpp.
void Console::drawStringSecondaryAlternate | ( | int | x, | |
int | y, | |||
const char * | msg | |||
) |
Draws a text string at a given position using colours from the provided skin using the alternate text colour from the secondary window
[in] | x | The X position at which to draw the text (cols) |
[in] | y | The Y position at which to draw the text (rows) |
[in] | msg | Message which to draw onto the screen |
Definition at line 466 of file console.cpp.
void Console::drawWindow | ( | int | startX, | |
int | startY, | |||
int | rows, | |||
int | cols, | |||
int | bgColor, | |||
int | title_textColor, | |||
int | title_textlineColor, | |||
int | title_bgColor, | |||
int | shadowColor, | |||
int | declColor, | |||
const char * | windowTitle | |||
) |
Draws a console based window
[in] | startX | starting X (cols) position of the window |
[in] | startY | starting Y (rows) position of the window |
[in] | rows | height of the window (rows) |
[in] | cols | width of the window (cols) |
[in] | bgColor | Background color of the window |
[in] | title_textColor | Colour of the title text |
[in] | title_textlineColor | Colour of the title line |
[in] | title_bgColor | Background colour of the window top |
[in] | shadowColor | Shadow Colour |
[in] | declColor | Colour of the left/right/bottom window decals |
[in] | windowTitle | Name of the window to display in the title |
draw the lines
Definition at line 220 of file console.cpp.
void Console::moveCursor | ( | int | row, | |
int | column | |||
) |
Moves the cursor to the provided row / column on the screen
[in] | row | The row (Y) position to move the cursor to. |
[in] | column | The column (X) position to move the cursor to. |
Definition at line 127 of file console.cpp.
void Console::registerSkin | ( | Skin | skin | ) |
Registers a skin to use with the console/skin functions
[in] | skin | the skin to register |
Definition at line 529 of file console.cpp.
void Console::setColor | ( | int | fgcolor, | |
int | bgcolor | |||
) |
Sets the Colour of the console text
[in] | fgcolor | The colour to set the foreground (text) to. |
[in] | bgcolor | The colour to set the text background to. |
Definition at line 138 of file console.cpp.
const int Console::BLACK = 0 [static] |
const int Console::BLUE = 14 [static] |
const int Console::CYAN = 16 [static] |
const int Console::DARK_BLUE = 4 [static] |
const int Console::DARK_CYAN = 6 [static] |
const int Console::DARK_GRAY = 10 [static] |
const int Console::DARK_GREEN = 2 [static] |
const int Console::DARK_MAGENTA = 5 [static] |
const int Console::DARK_RED = 1 [static] |
const int Console::DARK_YELLOW = 3 [static] |
const int Console::GRAY = 7 [static] |
const int Console::GREEN = 12 [static] |
const int Console::MAGENTA = 15 [static] |
const int Console::RED = 11 [static] |
const int Console::WHITE = 17 [static] |
const int Console::YELLOW = 13 [static] |