Carpenter Engine
A C++ game engine with a build once run anywhere solution
|
An input field for UI. More...
#include <UIInput.hpp>
Public Member Functions | |
UIInput (std::string name, const char *placeholder="") | |
Default Constructor. | |
void | Init () override |
Creates the UI element and adds it to the DOM. | |
int | getInputInt () |
Returns the input as an integer. | |
double | getInputDouble () |
Returns the input as a double. | |
std::string | getInputString () |
Returns the input as a string. | |
![]() | |
UIElement (std::string name) | |
Default Constructor. | |
~UIElement () override | |
void | AddTheme (const char *theme) |
Sets the theme of the UI element. | |
void | SetAnchor (const char *anchor) |
Sets the anchor of the UI element. | |
void | SetDimensions (Vec2f dimensions) |
Sets the dimensions of the UI element. | |
void | SetOffset (Vec2f offset) |
Sets the offset of the UI element. | |
void | OnEnable () override |
Shows the UI element when enabled. | |
void | OnDisable () override |
Hides the UI element when disabled. | |
![]() | |
Node (std::string name) | |
Default constructor. | |
virtual | ~Node () |
Default destructor. | |
size_t | AddChild (Node *child) |
Adds a child to the node and assigns itself as the parent of the new node. | |
Node * | GetChild (size_t index) |
Returns a reference to the child at the specified index. | |
Success | RemoveChild (size_t index) |
Removes the child at the specified index. | |
Success | SetEnabled (bool enabled=true) |
Toggles the state of the node. | |
virtual void | Draw () |
Overridable draw method for the node. | |
virtual void | Update (float dt) |
Overridable update method for the node. | |
Additional Inherited Members | |
![]() | |
const char * | m_nodeType |
std::string | m_name |
![]() | |
const char * | m_uiTag |
const char * | m_uiClass |
![]() | |
Node * | m_parent |
An input field for UI.
Takes in a text input, and you can get the input as an integer, double, or string.
Engine::UI::UIInput::UIInput | ( | std::string | name, |
const char * | placeholder = "" |
||
) |
Default Constructor.
takes in a name, and a placeholder text
name | The name of the UI element |
placeholder | The placeholder text |
double Engine::UI::UIInput::getInputDouble | ( | ) |
Returns the input as a double.
int Engine::UI::UIInput::getInputInt | ( | ) |
Returns the input as an integer.
std::string Engine::UI::UIInput::getInputString | ( | ) |
Returns the input as a string.
|
overridevirtual |
Creates the UI element and adds it to the DOM.
Reimplemented from Engine::UI::UIElement.