Input de texto. Más...
#include <text_input.h>
Métodos públicos | |
TextInput (SDL_Rect render_area, SDL_Renderer *renderer, SDL_Color font_color, SDL_Color background_color, TTF_Font *font, uint64_t max_len=UINT64_MAX) | |
Crea un objeto TextInput. Más... | |
void | add_characters (const char *characters) |
Agrega caracteres al texto. Más... | |
void | erase () |
Borra un caracter del texto. Más... | |
void | erase_all () |
Borra todo el texto escrito. Más... | |
void | render () |
Renderiza el textbox y todo su texto. Más... | |
std::string | get_text () |
Devuelve el texto escrito. Más... | |
void | toggle () |
Activa/desactiva el cursor. Más... | |
Input de texto.
TextInput::TextInput | ( | SDL_Rect | render_area, |
SDL_Renderer * | renderer, | ||
SDL_Color | font_color, | ||
SDL_Color | background_color, | ||
TTF_Font * | font, | ||
uint64_t | max_len = UINT64_MAX |
||
) |
Crea un objeto TextInput.
render_area | Area de la pantalla donde se va a renderizar el input. |
renderer | Renderer con el cual se renderizara el input. |
font_color | Color del texto. |
background_color | Color del fondo del input. |
font | Fuente tipografica del texto. |
void TextInput::add_characters | ( | const char * | characters | ) |
Agrega caracteres al texto.
characters | Caracteres a agregar. |
void TextInput::erase | ( | ) |
Borra un caracter del texto.
Si el texto esta vacio, no hace nada.
void TextInput::erase_all | ( | ) |
Borra todo el texto escrito.
std::string TextInput::get_text | ( | ) |
Devuelve el texto escrito.
void TextInput::render | ( | ) |
Renderiza el textbox y todo su texto.
void TextInput::toggle | ( | ) |
Activa/desactiva el cursor.