Peoplemon  0.1.0
Peoplemon 3 game source documentation
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
game::menu::PeoplemonButton Class Reference

Menu item for peoplemon. More...

#include <PeoplemonButton.hpp>

+ Inheritance diagram for game::menu::PeoplemonButton:

Public Types

using Ptr = std::shared_ptr< PeoplemonButton >
 

Public Member Functions

virtual ~PeoplemonButton ()=default
 Destroy the Peoplemon Button object. More...
 
void setHighlightColor (const sf::Color &color)
 Set the highlight color. More...
 
virtual glm::vec2 getSize () const override
 Returns the size of the button. More...
 
void sync (const core::pplmn::OwnedPeoplemon &ppl)
 Syncs the HP bar and ailment texture with the peoplemon. More...
 
void update (float dt)
 Updates the HP bar. More...
 
bool synced () const
 Returns whether or not this button is synced. More...
 

Static Public Member Functions

static Ptr create (const core::pplmn::OwnedPeoplemon &ppl)
 Creates a new peoplemon button from the peoplemon. More...
 

Protected Member Functions

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 return the transform to use. More...
 
virtual void doSceneAdd (bl::rc::Scene *overlay) override
 Called when the item should be added to the overlay. More...
 
virtual void doSceneRemove () override
 Called when the item should be removed from the overlay. More...
 
virtual bl::ecs::Entity getEntity () const override
 Returns the entity (or top level entity) of the item. More...
 
virtual void draw (bl::rc::scene::CodeScene::RenderContext &ctx) override
 Renders the item. More...
 

Detailed Description

Menu item for peoplemon.

Definition at line 17 of file PeoplemonButton.hpp.

Member Typedef Documentation

◆ Ptr

Definition at line 19 of file PeoplemonButton.hpp.

Constructor & Destructor Documentation

◆ ~PeoplemonButton()

virtual game::menu::PeoplemonButton::~PeoplemonButton ( )
virtualdefault

Destroy the Peoplemon Button object.

Member Function Documentation

◆ create()

PeoplemonButton::Ptr game::menu::PeoplemonButton::create ( const core::pplmn::OwnedPeoplemon ppl)
static

Creates a new peoplemon button from the peoplemon.

Parameters
pplThe peoplemon to represent
Returns
Ptr The new item

Definition at line 19 of file PeoplemonButton.cpp.

◆ doCreate()

void game::menu::PeoplemonButton::doCreate ( bl::engine::Engine &  engine)
overrideprotectedvirtual

Called at least once when the item is added to a menu. Should create required graphics primitives and return the transform to use.

Parameters
engineThe game engine instance

Definition at line 56 of file PeoplemonButton.cpp.

◆ doSceneAdd()

void game::menu::PeoplemonButton::doSceneAdd ( bl::rc::Scene *  overlay)
overrideprotectedvirtual

Called when the item should be added to the overlay.

Parameters
overlayThe overlay to add to

Definition at line 141 of file PeoplemonButton.cpp.

◆ doSceneRemove()

void game::menu::PeoplemonButton::doSceneRemove ( )
overrideprotectedvirtual

Called when the item should be removed from the overlay.

Definition at line 167 of file PeoplemonButton.cpp.

◆ draw()

void game::menu::PeoplemonButton::draw ( bl::rc::scene::CodeScene::RenderContext &  ctx)
overrideprotectedvirtual

Renders the item.

Parameters
ctxThe render context

Definition at line 156 of file PeoplemonButton.cpp.

◆ getEntity()

bl::ecs::Entity game::menu::PeoplemonButton::getEntity ( ) const
overrideprotectedvirtual

Returns the entity (or top level entity) of the item.

Definition at line 169 of file PeoplemonButton.cpp.

◆ getSize()

glm::vec2 game::menu::PeoplemonButton::getSize ( ) const
overridevirtual

Returns the size of the button.

Definition at line 39 of file PeoplemonButton.cpp.

◆ setHighlightColor()

void game::menu::PeoplemonButton::setHighlightColor ( const sf::Color &  color)

Set the highlight color.

Definition at line 34 of file PeoplemonButton.cpp.

◆ sync()

void game::menu::PeoplemonButton::sync ( const core::pplmn::OwnedPeoplemon ppl)

Syncs the HP bar and ailment texture with the peoplemon.

Parameters
pplThe peoplemon to sync with

Definition at line 41 of file PeoplemonButton.cpp.

◆ synced()

bool game::menu::PeoplemonButton::synced ( ) const

Returns whether or not this button is synced.

Definition at line 52 of file PeoplemonButton.cpp.

◆ update()

void game::menu::PeoplemonButton::update ( float  dt)

Updates the HP bar.

Parameters
dtTime elapsed in seconds

Definition at line 171 of file PeoplemonButton.cpp.


The documentation for this class was generated from the following files: