ClockItem.hpp 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. #ifndef CLOCK_CLOCKITEM_HPP
  2. #define CLOCK_CLOCKITEM_HPP
  3. #include <cpp3ds/Graphics/Drawable.hpp>
  4. #include <cpp3ds/Graphics/Text.hpp>
  5. #include <cpp3ds/Window/Event.hpp>
  6. #include <cpp3ds/System/Clock.hpp>
  7. #include "TweenObjects.hpp"
  8. #include <TweenEngine/Tween.h>
  9. #include <TweenEngine/TweenManager.h>
  10. #ifndef EMULATION
  11. #include <3ds.h>
  12. #endif
  13. namespace Clock {
  14. class ClockItem : public cpp3ds::Drawable, public util3ds::TweenTransformable<cpp3ds::Transformable> {
  15. public:
  16. void update(float delta);
  17. ClockItem();
  18. ~ClockItem();
  19. protected:
  20. virtual void draw(cpp3ds::RenderTarget& target, cpp3ds::RenderStates states) const;
  21. private:
  22. util3ds::TweenRectangleShape m_clockDial;
  23. util3ds::TweenRectangleShape m_clockScrew;
  24. util3ds::TweenRectangleShape m_hourHand;
  25. util3ds::TweenRectangleShape m_minuteHand;
  26. util3ds::TweenRectangleShape m_secondHand;
  27. util3ds::TweenText m_textTwelve;
  28. util3ds::TweenText m_textThree;
  29. util3ds::TweenText m_textSix;
  30. util3ds::TweenText m_textNein;
  31. cpp3ds::Clock m_updateClock;
  32. TweenEngine::TweenManager m_tweenManager;
  33. void updateHands();
  34. };
  35. } // namespace Clock
  36. #endif // CLOCK_CLOCKITEM_HPP