|
| | Switch (KTech::Engine &engine, KTech::ID< KTech::UI > ui, std::function< void()> OnPress, const std::string &key=KTech::Keys::return_, KTech::Point position={ 0, 0 }, const std::string &text="Switch", bool on=false, bool withFrame=false, KTech::RGBA unselectedOff=KTech::RGBAColors::gray, KTech::RGBA selectedOff=KTech::RGBAColors::white, KTech::RGBA unselectedOn=KTech::RGBAColors::Widgets::switchUnselectedOnGreen, KTech::RGBA selectedOn=KTech::RGBAColors::Widgets::switchSelectedOnGreen, KTech::RGBA down=KTech::RGBAColors::Widgets::buttonDownBlue) |
| | Construct a Switch.
|
| |
| void | SetText (const std::string &text, bool withFrame) |
| | Change the displayed text.
|
| |
| void | SetValue (bool value) |
| | Set the toggled value.
|
| |
| | Widget (Engine &engine, Point position=Point(0, 0), std::string name="") |
| | Construct a Widget.
|
| |
| | Widget (Engine &engine, const ID< UI > &parentUI, Point position=Point(0, 0), std::string name="") |
| | Construct a Widget and immediately enter a UI.
|
| |
| virtual | ~Widget () |
| | Leave parent UI (if in one) and remove itself from Memory.
|
| |
|
auto | AddWidget (const ID< Widget > &widget) -> bool |
| | Undocumented due to planned changes (see GitHub issue #106).
|
| |
|
auto | RemoveWidget (const ID< Widget > &widget) -> bool |
| | Undocumented due to planned changes (see GitHub issue #106).
|
| |
|
auto | RemoveAllWidgets () -> bool |
| | Undocumented due to planned changes (see GitHub issue #106).
|
| |
|
auto | EnterWidget (const ID< Widget > &widget) -> bool |
| | Undocumented due to planned changes (see GitHub issue #106).
|
| |
| auto | EnterUI (const ID< UI > &ui) -> bool |
| | Enter a UI.
|
| |
|
auto | LeaveWidget () -> bool |
| | Undocumented due to planned changes (see GitHub issue #106).
|
| |
| auto | LeaveUI () -> bool |
| | Leave the parent UI.
|
| |
| void | Select () |
| | Enable input callbacks, and call Widget::OnSelect().
|
| |
| void | Deselect () |
| | Disable input callbacks, and call Widget::OnDisable().
|
| |
| void | Show () |
| | Let UI render this Widget, and call Widget::OnShow().
|
| |
| void | Hide () |
| | Don't let UI render this Widget, and call Widget::OnHide().
|
| |
|
|
bool | m_on = false |
| | Toggled value.
|
| |
|
std::function< void()> | m_OnPress |
| | Function to call when pressed.
|
| |
|
Engine & | engine |
| | Parent Engine.
|
| |
|
const ID< Widget > | m_id {ID<Widget>::Unique()} |
| | Personal ID.
|
| |
|
std::string | m_name |
| | String name.
|
| |
|
ID< UI > | m_parentUI |
| | The UI containing this Widget.
|
| |
|
ID< Widget > | m_parentWidget = nullID<Widget> |
| | Undocumented because it's planned to change (see GitHub issue #106).
|
| |
|
std::vector< ChildWidget > | m_childWidgets |
| | Undocumented because it's planned to change (see GitHub issue #106).
|
| |
|
bool | m_selected = false |
| | true: player input reaches the Widget. false: player input doesn't.
|
| |
|
bool | m_shown = true |
| | true: will be rendered by UI. false: will be ignored by UI.
|
| |
|
Point | m_pos |
| | World position.
|
| |
|
std::vector< Texture > | m_textures = {} |
| | Comprising Textures.
|
| |
|
Input::CallbackGroup | m_callbackGroup |
| | Group of all input callbacks, which are enabled and disabled in correspondence to Widget::m_selected.
|
| |
Widget that toggles a value and calls a callback function when pressed.