ShishGL  1.0
A simple modular cross-platform graphics library
TextShape.hpp
Go to the documentation of this file.
1 /*============================================================================*/
2 #ifndef SHISHGL_TEXTSHAPE_HPP
3 #define SHISHGL_TEXTSHAPE_HPP
4 /*============================================================================*/
5 #include "Shape2D.hpp"
6 #include "Text.hpp"
7 #include "RenderSystem.hpp"
8 /*============================================================================*/
9 namespace Sh {
10 
11  class TextShape : public Shape2D {
12  public:
13 
14  explicit TextShape(const std::string_view& text,
15  IPlatform::Align text_align = IPlatform::Align::LEFT)
16  : Shape2D()
17  , s_text(text)
18  , align(text_align)
19  { }
20 
21  void draw(const Frame& frame) const override {
22  //PLATFORM().displayText(s_text, frame, align);
23  }
24 
25  [[nodiscard]]
26  bool contains(const Frame&, const Vector2<double>&) const override {
27  return true;
28  }
29 
30  private:
31 
32  std::string_view s_text;
33  IPlatform::Align align;
34  };
35 
36 }
37 /*============================================================================*/
38 #endif //SHISHGL_TEXTSHAPE_HPP
39 /*============================================================================*/
Sh::Shape2D
Definition: Shape2D.hpp:12
Sh::IPlatform::Align
Align
Definition: IPlatform.hpp:83
prettify_colors.text
text
Definition: prettify_colors.py:6
Sh::Frame
Definition: Frame.hpp:9
Sh::TextShape::contains
bool contains(const Frame &, const Vector2< double > &) const override
Definition: TextShape.hpp:26
Sh::Vector2< double >
Sh::TextShape::TextShape
TextShape(const std::string_view &text, IPlatform::Align text_align=IPlatform::Align::LEFT)
Definition: TextShape.hpp:14
Sh::TextShape::draw
void draw(const Frame &frame) const override
Definition: TextShape.hpp:21
Shape2D.hpp
Text.hpp
Sh::TextShape
Definition: TextShape.hpp:11
Sh
Definition: CoreApplication.hpp:10
RenderSystem.hpp