Peoplemon  0.1.0
Peoplemon 3 game source documentation
MoveInfoRow.hpp
Go to the documentation of this file.
1 #ifndef GAME_MENUS_MOVEINFOROW_HPP
2 #define GAME_MENUS_MOVEINFOROW_HPP
3 
4 #include <BLIB/Interfaces/Menu.hpp>
5 #include <BLIB/Resources.hpp>
7 
8 namespace game
9 {
10 namespace menu
11 {
17 class MoveInfoRow : public bl::menu::Item {
18 public:
25  static bl::menu::Item::Ptr create(core::pplmn::MoveId move);
26 
30  virtual ~MoveInfoRow() = default;
31 
35  virtual glm::vec2 getSize() const override;
36 
37 protected:
44  virtual void doCreate(bl::engine::Engine& engine) override;
45 
51  virtual void doSceneAdd(bl::rc::Scene* overlay) override;
52 
56  virtual void doSceneRemove() override;
57 
61  virtual bl::ecs::Entity getEntity() const override;
62 
68  virtual void draw(bl::rc::scene::CodeScene::RenderContext& ctx) override;
69 
70 private:
71  const core::pplmn::MoveId move;
72  bl::rc::res::TextureRef bgndTxtr;
73  bl::rc::res::TextureRef activeBgndTxtr;
74  bl::gfx::Sprite background;
75  bl::gfx::Text name;
76 
78  void makeActive();
79  void makeInactive();
80 };
81 
82 } // namespace menu
83 } // namespace game
84 
85 #endif
MoveId
The id of a move.
Definition: MoveId.hpp:16
Parent namespace for all functionality unique to the game.
Menu row item for moves on the peoplemon info screen.
Definition: MoveInfoRow.hpp:17
virtual void doSceneRemove() override
Called when the item should be removed from the overlay.
Definition: MoveInfoRow.cpp:48
virtual void doSceneAdd(bl::rc::Scene *overlay) override
Called when the item should be added to the overlay.
Definition: MoveInfoRow.cpp:43
virtual glm::vec2 getSize() const override
Returns the size of the menu item.
Definition: MoveInfoRow.cpp:21
static bl::menu::Item::Ptr create(core::pplmn::MoveId move)
Create a new move row.
Definition: MoveInfoRow.cpp:11
virtual void draw(bl::rc::scene::CodeScene::RenderContext &ctx) override
Renders the item.
Definition: MoveInfoRow.cpp:56
virtual ~MoveInfoRow()=default
Destroy the Move Info Row object.
virtual bl::ecs::Entity getEntity() const override
Returns the entity (or top level entity) of the item.
Definition: MoveInfoRow.cpp:50
virtual void doCreate(bl::engine::Engine &engine) override
Called at least once when the item is added to a menu. Should create required graphics primitives and...
Definition: MoveInfoRow.cpp:23