|
Study Dungeon
1.0.0
A group project for COSC345
|
Object repesenting the Console window. More...
#include <menu.h>
Public Member Functions | |
| ConsoleWindow () | |
| Construct a new Console Window object. | |
| virtual | ~ConsoleWindow ()=default |
| Destroy the Console Window object. | |
| void | updateSize () |
| Update the size of the console window. | |
| void | drawBorder () |
| Draws a border around the console. | |
| void | drawBox (int x, int y, size_t width, size_t height) |
| Draws a box. More... | |
| void | drawHorizontalLine (int x, int y, size_t length, char ch='-') |
| Draws a horizontal line using specified character. More... | |
| void | drawVerticalLine (int x, int y, size_t length, char ch='|') |
| Draws a vertical line using specified character. More... | |
| void | drawCharacter (int x, int y, char ch) |
| Puts a character on the screen at a position. More... | |
| void | drawText (const std::string &text, int x, int y) |
| Puts a string of text on the srceen starting at a position. More... | |
| void | drawCenteredText (const std::string &text, int y) |
| Put a string of text centered horizontally on the screen. More... | |
| std::string | getLine (int x, int y, size_t maxLength=0) |
| Create a blank text input field to recieve and display user input. More... | |
| void | clear () |
| Clear everything on the screen. | |
| COORD | getSize () const |
| Get the Size of the console window. More... | |
| void | checkWindowResize (UIManager &uiManager) |
| Check to see if the console window has been resized. More... | |
| void | setDefaultSize (short width, short height) |
| Set the default size of the console window. More... | |
| void | setConsoleWindowSize (short width, short height) |
| Set the size of the console window. More... | |
| void | addTextToBox (const std::string &text) |
| The text to be added to a text box. More... | |
| void | drawTextBox (int x, int y, size_t width, size_t height) |
| Draws a text box of specified dimensions. More... | |
| void | addAsciiArt (const AsciiArt &art) |
| void | drawAsciiArt (const std::string &name, int x=-1, int y=-1) |
| AsciiArt * | getAsciiArtByName (const std::string &name) |
| Get and ASCII art object by name. More... | |
| void | addANSIArt (const ANSIArt &art) |
| Add an ansi art object to the consolewindow object. More... | |
| void | drawANSIArt (const std::string &name, int x, int y) |
| Draws the ansi art object at a location. More... | |
| ANSIArt * | getANSIArtByName (const std::string &name) |
| Get an ANSI artwork by name. More... | |
| void | drawANSICode (int code, int x, int y) |
| Draws a 256bit colour on the screen at a position. More... | |
| void | drawWrappedText (const std::string &text, int x, int y, size_t width) |
| Draws text on the screen wrapping the string to the next line if it reaches the width. More... | |
Object repesenting the Console window.
| void ConsoleUI::ConsoleWindow::addANSIArt | ( | const ANSIArt & | art | ) |
Add an ansi art object to the consolewindow object.
| art | the ansi art oject to add |
| void ConsoleUI::ConsoleWindow::addAsciiArt | ( | const AsciiArt & | art | ) |
| art |
| void ConsoleUI::ConsoleWindow::addTextToBox | ( | const std::string & | text | ) |
The text to be added to a text box.
| text |
| void ConsoleUI::ConsoleWindow::checkWindowResize | ( | UIManager & | uiManager | ) |
Check to see if the console window has been resized.
| uiManager |
| void ConsoleUI::ConsoleWindow::drawANSIArt | ( | const std::string & | name, |
| int | x, | ||
| int | y | ||
| ) |
Draws the ansi art object at a location.
| name | name of the artwork to draw |
| x | left most position |
| y | top most position |
| void ConsoleUI::ConsoleWindow::drawANSICode | ( | int | code, |
| int | x, | ||
| int | y | ||
| ) |
Draws a 256bit colour on the screen at a position.
| code | 256bit colour code |
| x | left most position |
| y | top most position |
| void ConsoleUI::ConsoleWindow::drawAsciiArt | ( | const std::string & | name, |
| int | x = -1, |
||
| int | y = -1 |
||
| ) |
| name | |
| x | |
| y |
| void ConsoleUI::ConsoleWindow::drawBox | ( | int | x, |
| int | y, | ||
| size_t | width, | ||
| size_t | height | ||
| ) |
Draws a box.
| x | left most position |
| y | top most position |
| width | width of the box |
| height | height of the box |
| void ConsoleUI::ConsoleWindow::drawCenteredText | ( | const std::string & | text, |
| int | y | ||
| ) |
Put a string of text centered horizontally on the screen.
| text | string of text to be displayed |
| y | top most position |
| void ConsoleUI::ConsoleWindow::drawCharacter | ( | int | x, |
| int | y, | ||
| char | ch | ||
| ) |
Puts a character on the screen at a position.
| x | left most position |
| y | top most position |
| ch | character to draw |
| void ConsoleUI::ConsoleWindow::drawHorizontalLine | ( | int | x, |
| int | y, | ||
| size_t | length, | ||
| char | ch = '-' |
||
| ) |
Draws a horizontal line using specified character.
| x | left most position |
| y | top most position |
| length | length of the line |
| ch | character to use to make the line |
| void ConsoleUI::ConsoleWindow::drawText | ( | const std::string & | text, |
| int | x, | ||
| int | y | ||
| ) |
Puts a string of text on the srceen starting at a position.
| text | the string to be displayed |
| x | left most position |
| y | top most position |
| void ConsoleUI::ConsoleWindow::drawTextBox | ( | int | x, |
| int | y, | ||
| size_t | width, | ||
| size_t | height | ||
| ) |
Draws a text box of specified dimensions.
| x | left most position |
| y | top most position |
| width | width of the box |
| height | height of the box |
| void ConsoleUI::ConsoleWindow::drawVerticalLine | ( | int | x, |
| int | y, | ||
| size_t | length, | ||
| char | ch = '|' |
||
| ) |
Draws a vertical line using specified character.
| x | left most position |
| y | top most position |
| length | length of the line |
| ch | character to use to make th line |
| void ConsoleUI::ConsoleWindow::drawWrappedText | ( | const std::string & | text, |
| int | x, | ||
| int | y, | ||
| size_t | width | ||
| ) |
Draws text on the screen wrapping the string to the next line if it reaches the width.
| text | string of text to display |
| x | left most position |
| y | top most position |
| width | maximum width of the text |
| ANSIArt * ConsoleUI::ConsoleWindow::getANSIArtByName | ( | const std::string & | name | ) |
Get an ANSI artwork by name.
| name | name of the artwork |
| AsciiArt * ConsoleUI::ConsoleWindow::getAsciiArtByName | ( | const std::string & | name | ) |
Get and ASCII art object by name.
| name |
| std::string ConsoleUI::ConsoleWindow::getLine | ( | int | x, |
| int | y, | ||
| size_t | maxLength = 0 |
||
| ) |
Create a blank text input field to recieve and display user input.
| x | left most positition |
| y | top most position |
| maxLength | maximum length of the input field |
| COORD ConsoleUI::ConsoleWindow::getSize | ( | ) | const |
Get the Size of the console window.
| void ConsoleUI::ConsoleWindow::setConsoleWindowSize | ( | short | width, |
| short | height | ||
| ) |
Set the size of the console window.
| width | console window width |
| height | console window height |
| void ConsoleUI::ConsoleWindow::setDefaultSize | ( | short | width, |
| short | height | ||
| ) |
Set the default size of the console window.
| width | console window width |
| height | console window height |