R-Type
R-Type project
SplashScreen.hpp
1 /*
2 ** EPITECH PROJECT, 2022
3 ** gameEngine2
4 ** File description:
5 ** SplashScreen
6 */
7 
8 #ifndef SPLASHSCREEN_HPP_
9 #define SPLASHSCREEN_HPP_
10 
11 #include <string>
12 #include <vector>
13 #include <memory>
14 
15 #include "Vectors.hpp"
16 #include "Rectangle.hpp"
17 #include "Engine.hpp"
18 
19 namespace KapEngine {
20 
21  namespace SceneManagement {
22 
23  class SplashScreen {
24  public:
26  std::string pathImage;
27  int timing;
28  Tools::Vector2 pos;
29  Tools::Vector2 size;
30  Tools::Rectangle rect;
31 
32  SplashScreenNode(std::string path, int dur = 2) {
33  PROFILER_FUNC_START();
34  timing = dur;
35  size.setX(1.f);
36  size.setX(1.f);
37  pathImage = path;
38  PROFILER_FUNC_END();
39  }
40  };
41  public:
42  SplashScreen(KEngine &engine);
43  ~SplashScreen();
44 
45  void addSplashScreen(std::shared_ptr<SplashScreenNode> splash) {
46  PROFILER_FUNC_START();
47  _splahes.push_back(splash);
48  PROFILER_FUNC_END();
49  }
50 
51  void setDisplayKapEngineLogo(bool b) {
52  PROFILER_FUNC_START();
53  _displayKapEngineLogo = b;
54  PROFILER_FUNC_END();
55  }
56 
57  void __init();
58 
59  protected:
60  private:
61  KEngine &_engine;
62  std::vector<std::shared_ptr<SplashScreenNode>> _splahes;
63  bool _displayKapEngineLogo = true;
64  std::size_t _sceneId = 0;
65  };
66 
67  }
68 
69 }
70 
71 #endif /* !SPLASHSCREEN_HPP_ */
KapEngine::SceneManagement::SplashScreen::SplashScreenNode
Definition: SplashScreen.hpp:25
KapEngine::SceneManagement::SplashScreen
Definition: SplashScreen.hpp:23
KapEngine::Tools::Vector2
Definition: Vectors.hpp:25
KapEngine
main namespace
Definition: Component.hpp:17
KapEngine::Tools::Rectangle
Definition: Rectangle.hpp:23
KapEngine::KEngine
Class of engine.
Definition: Engine.hpp:60