NewsState.hpp 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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. util3ds::TweenableView m_bottomView;
  33. ScrollBar m_scrollbar;
  34. cpp3ds::Vector2f m_scrollSize;
  35. float m_scrollPos;
  36. };
  37. } // namespace FreeShop
  38. #endif // FREESHOP_NEWSSTATE_HPP