updated text.cpp

This commit is contained in:
2021-02-19 07:31:50 +01:00
parent 6ab8f39b92
commit 7fc0a86743
2 changed files with 16 additions and 117 deletions

View File

@@ -15,7 +15,7 @@ public:
~Text();
// Inicializador
void init(LTexture *texture, SDL_Renderer *renderer, Uint8 type, Uint8 size);
void init(LTexture *texture, SDL_Renderer *renderer, Uint8 height);
// Escribe el texto en pantalla
void write(int x, int y, std::string text);
@@ -36,31 +36,17 @@ public:
// Establece el valor de la variable
void setType(Uint8 type);
// Obtiene el valor de la variable
Uint8 getSize();
// Establece el valor de la variable
void setSize(Uint8 size);
private:
// Objeto con los graficos para el texto
Sprite *mSprite;
// Coordenadas dentro del PNG para cada código ascii y su anchura
struct Offset
{
int x;
int y;
Uint8 w;
};
// Vector con las posiciones y ancho de cada letra
Offset mOffset[255];
// Indica si el texto es de anchura fija o variable
Uint8 mType;
Uint8 mSize;
Sprite *mSprite; // Objeto con los graficos para el texto
SDL_Rect mOffset[255]; // Vector con las posiciones y ancho de cada letra
Uint8 mHeight; // Altura del texto
};
#endif