NewsState.hpp 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. #ifndef FREESHOP_NEWSSTATE_HPP
  2. #define FREESHOP_NEWSSTATE_HPP
  3. #include <cpp3ds/Window/Window.hpp>
  4. #include <TweenEngine/TweenManager.h>
  5. #include "State.hpp"
  6. #include "../TweenObjects.hpp"
  7. #include "../GUI/Scrollable.hpp"
  8. #include "../GUI/ScrollBar.hpp"
  9. namespace FreeShop {
  10. class NewsState: public State, public Scrollable {
  11. public:
  12. NewsState(StateStack& stack, Context& context, StateCallback callback);
  13. virtual void renderTopScreen(cpp3ds::Window& window);
  14. virtual void renderBottomScreen(cpp3ds::Window& window);
  15. virtual bool update(float delta);
  16. virtual bool processEvent(const cpp3ds::Event& event);
  17. virtual void setScroll(float position);
  18. virtual float getScroll();
  19. virtual const cpp3ds::Vector2f &getScrollSize();
  20. private:
  21. bool m_skippedFirstUpdate;
  22. bool m_isClosing;
  23. bool m_finishedFadeIn;
  24. util3ds::TweenRectangleShape m_overlay;
  25. util3ds::TweenNinePatch m_background;
  26. util3ds::TweenText m_title;
  27. util3ds::TweenText m_message;
  28. TweenEngine::TweenManager m_tweenManager;
  29. util3ds::TweenRectangleShape m_buttonOkBackground;
  30. util3ds::TweenText m_buttonOkText;
  31. cpp3ds::Font m_font;
  32. ScrollBar m_scrollbar;
  33. cpp3ds::Vector2f m_scrollSize;
  34. float m_scrollPos;
  35. };
  36. } // namespace FreeShop
  37. #endif // FREESHOP_NEWSSTATE_HPP