Menu item for an item in the store. Does both sellable and for-sale items.
More...
#include <StoreItemRow.hpp>
|
static constexpr float | Height = 18.f |
| Height of a single item in pixels. More...
|
|
|
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...
|
|
Menu item for an item in the store. Does both sellable and for-sale items.
Definition at line 18 of file StoreItemRow.hpp.
◆ Ptr
◆ ~StoreItemRow()
virtual game::menu::StoreItemRow::~StoreItemRow |
( |
| ) |
|
|
virtualdefault |
Destroy the Store Item Row object.
◆ create() [1/2]
Creates a new menu item in buy mode.
- Parameters
-
item | The item to buy |
price | The purchase price |
- Returns
- Ptr The new menu item
Definition at line 22 of file StoreItemRow.cpp.
◆ create() [2/2]
Creates a new menu item in sell mode.
- Parameters
-
qty | The number of items available to be sold |
item | The item to sell |
price | The sale price |
- Returns
- Ptr The new menu item
Definition at line 18 of file StoreItemRow.cpp.
◆ doCreate()
void game::menu::StoreItemRow::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
-
engine | The game engine instance |
Definition at line 39 of file StoreItemRow.cpp.
◆ doSceneAdd()
void game::menu::StoreItemRow::doSceneAdd |
( |
bl::rc::Scene * |
overlay | ) |
|
|
overrideprotectedvirtual |
Called when the item should be added to the overlay.
- Parameters
-
overlay | The overlay to add to |
Definition at line 69 of file StoreItemRow.cpp.
◆ doSceneRemove()
void game::menu::StoreItemRow::doSceneRemove |
( |
| ) |
|
|
overrideprotectedvirtual |
Called when the item should be removed from the overlay.
Definition at line 75 of file StoreItemRow.cpp.
◆ draw()
void game::menu::StoreItemRow::draw |
( |
bl::rc::scene::CodeScene::RenderContext & |
ctx | ) |
|
|
overrideprotectedvirtual |
◆ getEntity()
bl::ecs::Entity game::menu::StoreItemRow::getEntity |
( |
| ) |
const |
|
overrideprotectedvirtual |
Returns the entity (or top level entity) of the item.
Definition at line 81 of file StoreItemRow.cpp.
◆ getItem()
Returns the item that this row represents.
Definition at line 37 of file StoreItemRow.cpp.
◆ getSize()
glm::vec2 game::menu::StoreItemRow::getSize |
( |
| ) |
const |
|
overridevirtual |
◆ updateQty()
void game::menu::StoreItemRow::updateQty |
( |
int |
qty | ) |
|
Updates the text for how many items can be sold.
- Parameters
-
qty | The number of items left in the bag |
Definition at line 31 of file StoreItemRow.cpp.
◆ Height
constexpr float game::menu::StoreItemRow::Height = 18.f |
|
staticconstexpr |
The documentation for this class was generated from the following files: