R-Type
R-Type project
UiCanvas.hpp
1 /*
2 ** EPITECH PROJECT, 2022
3 ** gameEngine2
4 ** File description:
5 ** Canvas
6 */
7 
8 #ifndef UICANVAS_HPP_
9 #define UICANVAS_HPP_
10 
11 #include "Component.hpp"
12 
13 namespace KapEngine {
14  class Component;
15 }
16 
17 namespace KapEngine {
18 
19  namespace UI {
20 
21  class Canvas : public Component {
22  public:
23  enum ResizyngType {
24  PIXEL_CONSTANT,
25  RESIZE_WITH_SCREEN
26  };
27 
28  public:
29  Canvas(std::shared_ptr<GameObject> &go);
30  ~Canvas();
31 
32  void setResizeType(ResizyngType r) {
33  PROFILER_FUNC_START();
34  _resize = r;
35  PROFILER_FUNC_END();
36  }
37 
38  void setScreenCompare(Tools::Vector2 screenSizeCompare) {
39  PROFILER_FUNC_START();
40  _screenSizeCompare = screenSizeCompare;
41  PROFILER_FUNC_END();
42  }
43 
44  ResizyngType getResizeType() const {
45  PROFILER_FUNC_START();
46  PROFILER_FUNC_END();
47  return _resize;
48  }
49 
50  Tools::Vector2 getScreenSizeCompare() const {
51  return _screenSizeCompare;
52  }
53 
54  bool checkComponentValidity() override;
55 
56  protected:
57  private:
58  ResizyngType _resize = ResizyngType::PIXEL_CONSTANT;
59  Tools::Vector2 _screenSizeCompare;
60  };
61 
62  }
63 
64 }
65 
66 #endif /* !UICANVAS_HPP_ */
KapEngine::Component
Definition: Component.hpp:38
KapEngine::Tools::Vector2
Definition: Vectors.hpp:25
KapEngine
main namespace
Definition: Component.hpp:17
KapEngine::UI::Canvas::checkComponentValidity
bool checkComponentValidity() override
Check you component is runnable With this function you can add some conditions to make your component...
Definition: UiCanvas.cpp:22
KapEngine::UI::Canvas
Definition: UiCanvas.hpp:21