Platformer
Platformer
TextRenderComponent.hpp
1 #ifndef TEXT_RENDER_COMPONENT_HPP
2 #define TEXT_RENDER_COMPONENT_HPP
3 
4 #include <string>
5 
6 #include "FilePaths.hpp"
7 #include "RenderComponent.hpp"
8 #include "SDLFontWrapper.hpp"
9 
15  public:
18  SDL_Color color);
21  SDL_Color color,
23  std::string text);
24 
26  void ChangeText(
27  const std::string newText);
28 
29  private:
31  SDL_Color color;
32 
34  std::shared_ptr<SDLFontWrapper> font;
35 
37  const std::string FONT_PATH =
38  FullAssetsPath() + "Fonts/raleway/Raleway-Bold.ttf";
39 };
40 
41 #endif
A RenderComponent class.
Definition: RenderComponent.hpp:13
TextRenderComponent(SDL_Color color)
Constructs a TextRenderComponent.
Definition: TextRenderComponent.cpp:6
SDL_Color color
The color of this TextRenderComponent.
Definition: TextRenderComponent.hpp:31
void ChangeText(const std::string newText)
Changes the text of this TextRenderComponent.
Definition: TextRenderComponent.cpp:16
std::shared_ptr< SDLFontWrapper > font
The font of this TextRenderComponent.
Definition: TextRenderComponent.hpp:34
A TextRenderComponent class.
Definition: TextRenderComponent.hpp:14
const std::string FONT_PATH
The font path of this TextRenderComponent.
Definition: TextRenderComponent.hpp:37