1 #ifndef GAME_MENUS_PEOPLEMONBUTTON_HPP
2 #define GAME_MENUS_PEOPLEMONBUTTON_HPP
4 #include <BLIB/Interfaces/Menu.hpp>
19 using Ptr = std::shared_ptr<PeoplemonButton>;
45 virtual glm::vec2
getSize()
const override;
74 virtual void doCreate(bl::engine::Engine& engine)
override;
81 virtual void doSceneAdd(bl::rc::Scene* overlay)
override;
91 virtual bl::ecs::Entity
getEntity()
const override;
98 virtual void draw(bl::rc::scene::CodeScene::RenderContext& ctx)
override;
102 bl::engine::Engine* enginePtr;
103 bl::rc::Scene* overlay;
106 bl::rc::res::TextureRef txtr;
107 bl::rc::res::TextureRef faceTxtr;
108 bl::rc::res::TextureRef ailTxtr;
109 bl::gfx::Sprite image;
110 bl::gfx::Sprite face;
111 bl::gfx::Rectangle hpBar;
115 bl::gfx::Text hpText;
116 bl::gfx::Sprite ailment;
Ailment
Represents an ailment that a Peoplemon can have.
Parent namespace for all functionality unique to the game.
Represents an instance of a peoplemon. Can be a wild peoplemon, trainer, or player peoplemon....
virtual void doSceneAdd(bl::rc::Scene *overlay) override
Called when the item should be added to the overlay.
static Ptr create(const core::pplmn::OwnedPeoplemon &ppl)
Creates a new peoplemon button from the peoplemon.
virtual void doSceneRemove() override
Called when the item should be removed from the overlay.
virtual ~PeoplemonButton()=default
Destroy the Peoplemon Button object.
void setHighlightColor(const sf::Color &color)
Set the highlight color.
bool synced() const
Returns whether or not this button is synced.
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...
virtual void draw(bl::rc::scene::CodeScene::RenderContext &ctx) override
Renders the item.
std::shared_ptr< PeoplemonButton > Ptr
virtual glm::vec2 getSize() const override
Returns the size of the button.
void sync(const core::pplmn::OwnedPeoplemon &ppl)
Syncs the HP bar and ailment texture with the peoplemon.
void update(float dt)
Updates the HP bar.
virtual bl::ecs::Entity getEntity() const override
Returns the entity (or top level entity) of the item.