Argentum Online - Cliente
stat_bar.h
1 #ifndef __STAT_BAR_H
2 #define __STAT_BAR_H
3 
4 #include "../SDL/sdl_text.h"
5 #include "SDL2/SDL.h"
6 
11 class StatBar {
12  private:
13  SDL_Renderer* renderer;
14  SDL_Rect render_area;
15  SDL_Color bar_color;
16  SDLText render_text;
17  unsigned int max_value;
18  unsigned int current_value;
19 
20  void _render_bar();
21  void _render_text();
22 
23  public:
34  StatBar(SDL_Rect render_area, TTF_Font* font, SDL_Renderer* renderer,
35  unsigned int max_value, SDL_Color bar_color, SDL_Color text_color);
36  ~StatBar();
37 
45  void set_current_value(unsigned int new_current_value);
46 
52  void set_max_value(unsigned int new_max_value);
53 
58  void render();
59 };
60 
61 #endif
StatBar::set_current_value
void set_current_value(unsigned int new_current_value)
Setea el valor actual del stat.
Definition: stat_bar.cpp:47
StatBar::set_max_value
void set_max_value(unsigned int new_max_value)
Setea el nuevo valor maximo del stat.
Definition: stat_bar.cpp:54
StatBar::StatBar
StatBar(SDL_Rect render_area, TTF_Font *font, SDL_Renderer *renderer, unsigned int max_value, SDL_Color bar_color, SDL_Color text_color)
Crea un objeto StatBar.
Definition: stat_bar.cpp:3
StatBar::render
void render()
Renderiza la statbar.
Definition: stat_bar.cpp:62
SDLText
Objeto de texto de SDL.
Definition: sdl_text.h:13
StatBar
Barra de stat, usado en HP, MP y Experiencia.
Definition: stat_bar.h:11