working on new font engine
This commit is contained in:
@@ -21,20 +21,24 @@ private:
|
||||
int y;
|
||||
Uint8 w;
|
||||
};
|
||||
Offset mOffset[255]; // Vector con las posiciones y ancho de cada letra
|
||||
Offset mOffset[128]; // 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
|
||||
Uint8 mBoxWidth; // Anchura de la caja de cada caracter en el png
|
||||
Uint8 mBoxHeight; // Altura de la caja de cada caracter en el png
|
||||
std::string mFile; // Fichero con los descriptores de la fuente
|
||||
|
||||
// Inicializa el vector de offsets desde un fichero
|
||||
void initOffsetFromFile();
|
||||
|
||||
public:
|
||||
// Constructor
|
||||
Text(LTexture *texture, SDL_Renderer *renderer);
|
||||
Text(std::string file, LTexture *texture, SDL_Renderer *renderer);
|
||||
|
||||
// Destructor
|
||||
~Text();
|
||||
|
||||
// Inicializador
|
||||
void init(Uint8 type, Uint8 size);
|
||||
void init();
|
||||
|
||||
// Escribe el texto en pantalla
|
||||
void write(int x, int y, std::string text, int kerning = 0, int lenght = -1);
|
||||
@@ -54,17 +58,8 @@ public:
|
||||
// Obtiene la longitud en pixels de una cadena
|
||||
Uint16 lenght(std::string text, int kerning);
|
||||
|
||||
// Obtiene el valor de la variable
|
||||
Uint8 getType();
|
||||
|
||||
// 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);
|
||||
// Devuelve el valor de la variable
|
||||
Uint8 getCharacterWidth();
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user