mElite  1.0
An Elite clone based on TextElite by Jan-Philipp Kappmeier and Melanie Schmidt.
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Public Member Functions | List of all members
TextInput Class Reference

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.
 

Detailed Description

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.

Constructor & Destructor Documentation

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.

Member Function Documentation

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.

Parameters
letterthe 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.


The documentation for this class was generated from the following files: