forked from jaildesigner-jailgames/coffee_crisis
release v1.3 beta 1
This commit is contained in:
102
source/text2.h
Normal file
102
source/text2.h
Normal file
@@ -0,0 +1,102 @@
|
||||
#pragma once
|
||||
#include "sprite.h"
|
||||
#include "text.h"
|
||||
|
||||
#ifndef TEXT2_H
|
||||
#define TEXT2_H
|
||||
|
||||
// Clase texto. Pinta texto en pantalla a partir de un bitmap
|
||||
class Text2 : public Text
|
||||
{
|
||||
public:
|
||||
// Constructor
|
||||
Text2();
|
||||
|
||||
// Destructor
|
||||
~Text2();
|
||||
|
||||
// Inicializador
|
||||
void init(LTexture *texture, SDL_Renderer *renderer, Uint8 type, Uint8 size);
|
||||
|
||||
// Establece el valor de la variable
|
||||
void setPosX(int value);
|
||||
|
||||
// Establece el valor de la variable
|
||||
void setPosY(int value);
|
||||
|
||||
// Establece el valor de la variable
|
||||
void setKerning(int value);
|
||||
|
||||
// Establece el valor de la variable
|
||||
void setCaption(std::string text);
|
||||
|
||||
// Establece el valor de la variable
|
||||
void setWrittingSpeed(Uint16 value);
|
||||
|
||||
// Establece el valor de la variable
|
||||
void setEnabled(bool value);
|
||||
|
||||
// Obtiene el valor de la variable
|
||||
bool IsEnabled();
|
||||
|
||||
// Establece el valor de la variable
|
||||
void setEnabledTimer(Uint16 value);
|
||||
|
||||
// Obtiene el valor de la variable
|
||||
Uint16 getEnabledTimer();
|
||||
|
||||
// Actualiza el objeto
|
||||
void update();
|
||||
|
||||
// Dibuja el objeto en pantalla
|
||||
void render();
|
||||
|
||||
// Centra la cadena de texto a un punto X
|
||||
void center(int x);
|
||||
|
||||
// Establece el valor de la variable
|
||||
void setId(int id);
|
||||
|
||||
// Establece el valor de la variable
|
||||
void setIntroEvents(Uint8 *value);
|
||||
|
||||
private:
|
||||
// Posicion X/Y donde empezar a escribir el texto
|
||||
int mPosX;
|
||||
int mPosY;
|
||||
|
||||
// Kerning del texto
|
||||
int mKerning;
|
||||
|
||||
// Texto para escribir
|
||||
std::string mCaption;
|
||||
|
||||
// Velocidad de escritura
|
||||
Uint16 mWrittingSpeed;
|
||||
|
||||
// Temporizador de escritura para cada caracter
|
||||
Uint16 mWrittingTimer;
|
||||
|
||||
// Posición del texto que se está escribiendo
|
||||
Uint16 mIndex;
|
||||
|
||||
// Longitud de la cadena a escribir
|
||||
Uint16 mLenght;
|
||||
|
||||
// Indica si se ha escrito todo el texto
|
||||
bool mWrittingCompleted;
|
||||
|
||||
// Indica si el objeto está habilitado
|
||||
bool mEnabled;
|
||||
|
||||
// Temporizador para deshabilitar el objeto
|
||||
Uint16 mEnabledTimer;
|
||||
|
||||
// Identificador
|
||||
int mId;
|
||||
|
||||
// Dirección del array de eventos donde notificar el estado
|
||||
Uint8 *mIntroEvents;
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user