![]() |
Peoplemon
0.1.0
Peoplemon 3 game source documentation
|
Cursor that is used to navigate the storage system boxes. More...
#include <StorageCursor.hpp>
Public Member Functions | |
StorageCursor (bl::engine::Engine &engine) | |
Construct a new Storage Cursor. More... | |
void | activate (bl::ecs::Entity parent) |
Adds to the current overlay. More... | |
void | deactivate () |
Removes from the current scene. More... | |
void | setHidden (bool hide) |
Show or hide the cursor. More... | |
void | update (float dt) |
Updates the cursor motion. More... | |
bool | process (core::input::EntityControl cmd, bool skipAnim) |
Processes user input to move the cursor. More... | |
void | setHolding (core::pplmn::Id peoplemon) |
Sets a Peoplemon to render with the cursor. Pass Unknown to clear. More... | |
bool | moving () const |
Returns whether or not the cursor position is being interpolated. More... | |
const sf::Vector2i & | getPosition () const |
Returns the position of the cursor in the box. More... | |
void | setX (int x) |
Sets the x position of the cursor. More... | |
void | pageLeft () |
Updates the cursor position if the box to the left is switched to. More... | |
void | pageRight () |
Updates the cursor position if the box to the right is switched to. More... | |
Static Public Member Functions | |
static float | TileSize () |
Returns the size of a square on the grid. More... | |
Cursor that is used to navigate the storage system boxes.
Definition at line 19 of file StorageCursor.hpp.
game::menu::StorageCursor::StorageCursor | ( | bl::engine::Engine & | engine | ) |
Construct a new Storage Cursor.
engine | The game engine instance |
Definition at line 38 of file StorageCursor.cpp.
void game::menu::StorageCursor::activate | ( | bl::ecs::Entity | parent | ) |
Adds to the current overlay.
parent | The parent entity for correct render order |
Definition at line 53 of file StorageCursor.cpp.
void game::menu::StorageCursor::deactivate | ( | ) |
Removes from the current scene.
Definition at line 68 of file StorageCursor.cpp.
const sf::Vector2i & game::menu::StorageCursor::getPosition | ( | ) | const |
Returns the position of the cursor in the box.
Definition at line 182 of file StorageCursor.cpp.
bool game::menu::StorageCursor::moving | ( | ) | const |
Returns whether or not the cursor position is being interpolated.
Definition at line 180 of file StorageCursor.cpp.
void game::menu::StorageCursor::pageLeft | ( | ) |
Updates the cursor position if the box to the left is switched to.
Definition at line 189 of file StorageCursor.cpp.
void game::menu::StorageCursor::pageRight | ( | ) |
Updates the cursor position if the box to the right is switched to.
Definition at line 194 of file StorageCursor.cpp.
bool game::menu::StorageCursor::process | ( | core::input::EntityControl | cmd, |
bool | skipAnim | ||
) |
Processes user input to move the cursor.
cmd | The user input |
skipAnim | True to skip the rest of an in-progress animation and move right away |
Definition at line 105 of file StorageCursor.cpp.
void game::menu::StorageCursor::setHidden | ( | bool | hide | ) |
Show or hide the cursor.
hide | True to hide, false to show |
Definition at line 74 of file StorageCursor.cpp.
void game::menu::StorageCursor::setHolding | ( | core::pplmn::Id | peoplemon | ) |
Sets a Peoplemon to render with the cursor. Pass Unknown to clear.
peoplemon | The peoplemon thumbnail to hold |
Definition at line 150 of file StorageCursor.cpp.
void game::menu::StorageCursor::setX | ( | int | x | ) |
Sets the x position of the cursor.
x | The new x position |
Definition at line 184 of file StorageCursor.cpp.
|
static |
Returns the size of a square on the grid.
Definition at line 205 of file StorageCursor.cpp.
void game::menu::StorageCursor::update | ( | float | dt | ) |
Updates the cursor motion.
dt | Time elapsed in seconds |
Definition at line 84 of file StorageCursor.cpp.