You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

51 regels
854 B

  1. #ifndef ELEMENTS_H
  2. #define ELEMENTS_H
  3. #include "Vector2.h"
  4. #include "GraphicsEngine.h"
  5. /*
  6. ** Elements have properties and behaviours
  7. ** they are instantiable / destructibles dynamically in scenes
  8. ** equivalent of game objects in game engines
  9. */
  10. /*
  11. ** Base class to inherit
  12. */
  13. class Element
  14. {
  15. public:
  16. Vector2 Position;
  17. virtual void Initialize();
  18. virtual void Update();
  19. virtual void Draw(GraphicsEngine *graphics);
  20. };
  21. class PopUp : public Element
  22. {
  23. public:
  24. void Initialize() override;
  25. void Update() override;
  26. void Draw(GraphicsEngine *graphics) override;
  27. void Show(bool animate);
  28. void Hide();
  29. bool IsShowned();
  30. String Line1;
  31. String Line2;
  32. String Line3;
  33. String Line4;
  34. private:
  35. uint16_t percentage;
  36. uint64_t t_start;
  37. bool is_animating = false;
  38. uint16_t anim_speed_ms = 300;
  39. bool show = false;
  40. };
  41. #endif