IconSet.hpp 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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. void resetIcon(int index, bool isAnimated = true);
  22. protected:
  23. virtual void draw(cpp3ds::RenderTarget &target, cpp3ds::RenderStates states) const;
  24. void resize();
  25. private:
  26. int m_selectedIndex;
  27. float m_padding;
  28. std::vector<util3ds::TweenText> m_icons;
  29. TweenEngine::TweenManager m_tweenManager;
  30. };
  31. } // namepace FreeShop
  32. #endif // FREESHOP_ICONSET_HPP