mElite
1.0
An Elite clone based on TextElite by Jan-Philipp Kappmeier and Melanie Schmidt.
|
Allows keyboard interacton, receives key presses and can print the current text to the screen using OpenGL TextureFont. More...
#include <TextInput.h>
Public Member Functions | |
TextInput (TextureFont *tf) | |
The constructor initializes the character array and sets the font object for printing the text to the screen. | |
~TextInput (void) | |
Destructor, does nothing. | |
GLvoid | back (GLvoid) |
Deletes one character of the character array until it's empty. | |
char * | getText (GLvoid) |
Returns a pointer to the textarray. | |
GLvoid | newLetter (char letter) |
Add a new letter. | |
GLvoid | print (GLvoid) |
Prints the text in the character array. | |
GLvoid | reset (GLvoid) |
resets the text to an empty string. | |
Allows keyboard interacton, receives key presses and can print the current text to the screen using OpenGL TextureFont.
Definition at line 13 of file TextInput.h.
TextInput::TextInput | ( | TextureFont * | tf | ) |
The constructor initializes the character array and sets the font object for printing the text to the screen.
Definition at line 12 of file TextInput.cpp.
TextInput::~TextInput | ( | void | ) |
Destructor, does nothing.
Definition at line 21 of file TextInput.cpp.
GLvoid TextInput::back | ( | GLvoid | ) |
Deletes one character of the character array until it's empty.
Definition at line 27 of file TextInput.cpp.
char * TextInput::getText | ( | GLvoid | ) |
Returns a pointer to the textarray.
Definition at line 36 of file TextInput.cpp.
GLvoid TextInput::newLetter | ( | char | letter | ) |
Add a new letter.
The maximum is set to 255 due to the last character has to be \0.
letter | the new letter that should be inserted |
Definition at line 45 of file TextInput.cpp.
GLvoid TextInput::print | ( | GLvoid | ) |
Prints the text in the character array.
Therefore a TextInput object is used which is submitted to the constructor at creation time.
Definition at line 56 of file TextInput.cpp.
GLvoid TextInput::reset | ( | GLvoid | ) |
resets the text to an empty string.
Definition at line 71 of file TextInput.cpp.