![]() |
Peoplemon
0.1.0
Peoplemon 3 game source documentation
|
A screen keyboard for getting arbitrary user input. More...
#include <ScreenKeyboard.hpp>
Public Types | |
using | OnSubmit = std::function< void(const std::string &)> |
Public Member Functions | |
ScreenKeyboard (bl::engine::Engine &engine, const OnSubmit &onSubmit) | |
Construct a new Screen Keyboard. More... | |
~ScreenKeyboard () | |
Unsubscribes the keyboard if still subscribed. More... | |
void | start (unsigned int minLen=0, unsigned int maxLen=16) |
Subscribes the keyboard to the event bus. More... | |
void | stop () |
Unsubscribes the keyboard from the event bus. More... | |
void | setPosition (const sf::Vector2f &position) |
Sets the position of the keyboard. The default is (??) More... | |
const std::string & | value () const |
Returns the current input value. More... | |
sf::Vector2f | getSize () const |
Returns the size of the screen keyboard. More... | |
void | process (unsigned int ctrl, bool ignoreDebounce) |
Handles player input. More... | |
A screen keyboard for getting arbitrary user input.
Definition at line 27 of file ScreenKeyboard.hpp.
using core::system::hud::ScreenKeyboard::OnSubmit = std::function<void(const std::string&)> |
Definition at line 29 of file ScreenKeyboard.hpp.
core::system::hud::ScreenKeyboard::ScreenKeyboard | ( | bl::engine::Engine & | engine, |
const OnSubmit & | onSubmit | ||
) |
Construct a new Screen Keyboard.
engine | The game engine instance |
onSubmit | Callback to call when the input is submitted |
Definition at line 19 of file ScreenKeyboard.cpp.
core::system::hud::ScreenKeyboard::~ScreenKeyboard | ( | ) |
Unsubscribes the keyboard if still subscribed.
Definition at line 121 of file ScreenKeyboard.cpp.
sf::Vector2f core::system::hud::ScreenKeyboard::getSize | ( | ) | const |
Returns the size of the screen keyboard.
Definition at line 156 of file ScreenKeyboard.cpp.
void core::system::hud::ScreenKeyboard::process | ( | unsigned int | ctrl, |
bool | ignoreDebounce | ||
) |
Handles player input.
ctrl | The control to process, in raw form |
ignoreDebounce | True to ignore debounce and process always, false to rate limit |
Definition at line 143 of file ScreenKeyboard.cpp.
void core::system::hud::ScreenKeyboard::setPosition | ( | const sf::Vector2f & | position | ) |
Sets the position of the keyboard. The default is (??)
Definition at line 147 of file ScreenKeyboard.cpp.
void core::system::hud::ScreenKeyboard::start | ( | unsigned int | minLen = 0 , |
unsigned int | maxLen = 16 |
||
) |
Subscribes the keyboard to the event bus.
minLen | Minimum input length to accept |
maxLen | Maximum input length to accept |
Definition at line 123 of file ScreenKeyboard.cpp.
void core::system::hud::ScreenKeyboard::stop | ( | ) |
Unsubscribes the keyboard from the event bus.
Definition at line 138 of file ScreenKeyboard.cpp.
const std::string & core::system::hud::ScreenKeyboard::value | ( | ) | const |
Returns the current input value.
Definition at line 154 of file ScreenKeyboard.cpp.