IconSet.hpp 986 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #ifndef FREESHOP_ICONSET_HPP
  2. #define FREESHOP_ICONSET_HPP
  3. #include <cpp3ds/Graphics/Drawable.hpp>
  4. #include <cpp3ds/Graphics/Texture.hpp>
  5. #include <cpp3ds/Graphics/Sprite.hpp>
  6. #include <TweenEngine/TweenManager.h>
  7. #include <cpp3ds/Window/Event.hpp>
  8. #include "TweenObjects.hpp"
  9. #include "AppItem.hpp"
  10. namespace FreeShop {
  11. class IconSet : public cpp3ds::Drawable, public util3ds::TweenTransformable<cpp3ds::Transformable> {
  12. public:
  13. static const int ALPHA = 11;
  14. IconSet();
  15. ~IconSet();
  16. bool processEvent(const cpp3ds::Event& event);
  17. void update(float delta);
  18. void addIcon(const cpp3ds::String &string);
  19. void setSelectedIndex(int index);
  20. int getSelectedIndex() const;
  21. protected:
  22. virtual void draw(cpp3ds::RenderTarget &target, cpp3ds::RenderStates states) const;
  23. void resize();
  24. private:
  25. int m_selectedIndex;
  26. float m_padding;
  27. std::vector<util3ds::TweenText> m_icons;
  28. TweenEngine::TweenManager m_tweenManager;
  29. };
  30. } // namepace FreeShop
  31. #endif // FREESHOP_ICONSET_HPP