code reorganized
This commit is contained in:
@@ -7,6 +7,20 @@
|
||||
// Clase texto. Pinta texto en pantalla a partir de un bitmap
|
||||
class Text
|
||||
{
|
||||
private:
|
||||
Sprite *mSprite;// Objeto con los graficos para el texto
|
||||
|
||||
struct Offset
|
||||
{
|
||||
int x;
|
||||
int y;
|
||||
Uint8 w;
|
||||
};
|
||||
Offset mOffset[255];// Vector con las posiciones y ancho de cada letra
|
||||
|
||||
Uint8 mType;// Indica si el texto es de anchura fija o variable
|
||||
Uint8 mSize;// Altura del texto
|
||||
|
||||
public:
|
||||
// Constructor
|
||||
Text();
|
||||
@@ -26,7 +40,7 @@ public:
|
||||
void writeColored(int x, int y, std::string text, Uint8 R, Uint8 G, Uint8 B);
|
||||
|
||||
// Escribe el texto centrado en un punto x y con kerning
|
||||
void writeCentered(int x, int y, std::string text, int kerning);
|
||||
void writeCentered(int x, int y, std::string text, int kerning = 0);
|
||||
|
||||
// Obtiene la longitud en pixels de una cadena
|
||||
Uint16 lenght(std::string text, int kerning);
|
||||
@@ -42,25 +56,6 @@ public:
|
||||
|
||||
// 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;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user