Argentum Online - Cliente
sdl_text.h
1 #ifndef __SDL_TEXT_H
2 #define __SDL_TEXT_H
3 
4 #include <cstdint>
5 
6 #include "SDL2/SDL_ttf.h"
7 #include "sdl_texture.h"
8 
13 class SDLText : public SDLTexture {
14  private:
15  SDL_Color text_color;
16  TTF_Font* font;
17 
18  public:
27  SDLText(const std::string& text, TTF_Font* font, SDL_Color color,
28  SDL_Renderer* renderer);
29 
30  /* No se permite construccion por copia*/
31  SDLText(const SDLText& other) = delete;
32  SDLText operator=(const SDLText& other) = delete;
33 
34  /* Constructor por movimiento.*/
35  SDLText(SDLText&& other);
36  SDLText& operator=(SDLText&& other);
37  ~SDLText();
38 
44  void update_text(const std::string& text);
45 };
46 
47 #endif
SDLTexture
Objeto de textura de SDL.
Definition: sdl_texture.h:13
SDLText::SDLText
SDLText(const std::string &text, TTF_Font *font, SDL_Color color, SDL_Renderer *renderer)
Crea un objeto SDLText.
Definition: sdl_text.cpp:8
SDLText::update_text
void update_text(const std::string &text)
Cambia el texto a renderizar.
Definition: sdl_text.cpp:35
SDLText
Objeto de texto de SDL.
Definition: sdl_text.h:13