#include <console.h>
Inheritance diagram for KrConsole:
Public Member Functions | |
KrConsole (int width, int height, int lineSpacing, const KrScheme &scheme) | |
The font resource to use is passed in, as well as the size of the console box. | |
void | SetBackgroundColor (const KrRGBA &color) |
Set a background color Only works after the KrConsole has been added to the Tree. | |
void | PushText (const char *text) |
Prints out a null termintated text string. | |
void | Print (const char *format,...) |
Prints using "printf" format. Will handle newlines. | |
void | GetEntryTextChar (std::string *buffer) |
Get the current text in the command line. | |
void | AddCommand (const std::string &) |
Adds a command to the list of recognized (and auto-completed) commands. | |
KrImNode * | ToExtended (const std::string &name) |
A generic cast. | |
virtual bool | HandleWidgetEvent (KrWidget *source, const KrWidgetEvent &event) |
Handle widget events, return true if handled, false if not ours. |
Emulates a simple command console, with one line text editing, history buffer, and command completion.
Needs SDL_EnableUNICODE( true ) to function correctly.
Events Sent
KrConsole::KrConsole | ( | int | width, | |
int | height, | |||
int | lineSpacing, | |||
const KrScheme & | scheme | |||
) |
The font resource to use is passed in, as well as the size of the console box.
The lineSpacing can be used to give additional space between lines. The normal behavior is zero.
WARNING: The font is in the scheme, and must be set.
KrImNode* KrConsole::ToExtended | ( | const std::string & | name | ) | [inline, virtual] |
A generic cast.
The Kyra library is not as extensible as it could be; this implements a "cheap RTTI" if you add your own sub-classes. Arbitrary casting to any type in the string. For example,
MyClassType* myType = (MyClassType*) node->ToExtended( "MyClassType" );
Reimplemented from KrImNode.