Argentum Online - Cliente
text_box.h
1 #ifndef __TEXT_BOX_H
2 #define __TEXT_BOX_H
3 #include <deque>
4 #include <string>
5 #include <vector>
6 
7 #include "../SDL/sdl_text.h"
8 #include "SDL2/SDL.h"
9 
14 class TextBox {
15  private:
16  std::deque<std::string> lines;
17  std::vector<SDLText> render_lines;
18  SDL_Rect render_area;
19  SDL_Renderer* renderer;
20  int nlines;
21  SDL_Color background_color;
22  void render_background();
23 
24  public:
35  TextBox(SDL_Rect render_area, SDL_Renderer* renderer, int nlines,
36  SDL_Color font_color, SDL_Color background_color, TTF_Font* font);
37  ~TextBox();
38 
43  void erase_all();
44 
50  void add_line(std::string string);
51 
56  void render();
57 };
58 
59 #endif
TextBox::erase_all
void erase_all()
Borra todo el texto del textbox.
Definition: text_box.cpp:19
TextBox::add_line
void add_line(std::string string)
Agrega una nueva linea al textbox.
Definition: text_box.cpp:21
TextBox::TextBox
TextBox(SDL_Rect render_area, SDL_Renderer *renderer, int nlines, SDL_Color font_color, SDL_Color background_color, TTF_Font *font)
Crea un objeto TextBox.
Definition: text_box.cpp:5
TextBox::render
void render()
Renderiza el textbox.
Definition: text_box.cpp:40
TextBox
Caja de texto. Usada en el chat.
Definition: text_box.h:14