on_screen_keyboard: Ya dibuja el objeto básico en pantalla
This commit is contained in:
@@ -8,36 +8,56 @@
|
||||
#ifndef ON_SCREEN_KEYBOARD_H
|
||||
#define ON_SCREEN_KEYBOARD_H
|
||||
|
||||
#define USE_UPPER 1
|
||||
#define USE_LOWER 2
|
||||
#define USE_NUMBER 4
|
||||
#define USE_SYMBOL 8
|
||||
|
||||
using namespace std;
|
||||
|
||||
class OnScreenKeyboard
|
||||
{
|
||||
private:
|
||||
|
||||
// Objetos y punteros
|
||||
SDL_Renderer *renderer; // El renderizador de la ventana
|
||||
Texture *iconTexture; // Textura para los gráficos
|
||||
Text *text; // Objeto para dibujar texto
|
||||
Input *input; // Gestor de eventos de entrada de teclado o gamepad
|
||||
options_t *options; // Variable con todas las opciones del programa
|
||||
SDL_Texture *texture; // Textura donde dibujar el objeto
|
||||
|
||||
// Variables
|
||||
string letters;
|
||||
string char_upper; // Cadena de texto con las letras en mayúscula
|
||||
string char_lower; // Cadena de texto con las letras en minuscula
|
||||
string char_numbers; // Cadena de texto con los números
|
||||
string char_symbol; // Cadena de texto con los símbolos
|
||||
color_t bgColor; // Color usado para el fondo
|
||||
string caption; // Texto a mostrar junto al texto a introducir
|
||||
int width; // Ancho del objeto
|
||||
int height; // Altura del objeto
|
||||
SDL_Rect dest; // Coordenadas donde se dibuja el objeto en pantalla
|
||||
|
||||
// Rellena la textura de fondo con el color y el texto
|
||||
void fillTexture();
|
||||
|
||||
public:
|
||||
|
||||
// Constructor
|
||||
OnScreenKeyboard(SDL_Renderer *renderer, Input *input, string iconFile, string bitmapFile, string textFile, options_t *options);
|
||||
OnScreenKeyboard(SDL_Renderer *renderer, Input *input, string iconFile, string bitmapFile, string textFile, options_t *options, int width, int height, color_t color = {0, 0, 0});
|
||||
|
||||
// Destructor
|
||||
~OnScreenKeyboard();
|
||||
|
||||
// Actualiza la lógica del objeto
|
||||
void update();
|
||||
// Actualiza la lógica del objeto
|
||||
void update();
|
||||
|
||||
// Dibuja el objeto en pantalla
|
||||
void render();
|
||||
// Dibuja el objeto en pantalla
|
||||
void render();
|
||||
|
||||
// Establece el color de fondo
|
||||
void setBgColor(color_t color);
|
||||
|
||||
// Establece el texto a mostrar junto al texto a introducir
|
||||
void setCaption(string text);
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user