|
Potato Engine
|
UI element that can be displayed on screen. More...
#include <Widget.hpp>
Public Member Functions | |
| Widget (std::string UID) | |
| Constructs widget. | |
| std::string | GetUID () const |
| Gets unique ID of widget. | |
| template<typename ElemType> | |
| ElemType * | AddElement (std::string name) |
| Creates and adds WidgetElement to widget screen. | |
| const std::unordered_map< std::string, WidgetElement * > & | GetAllElements () const |
| Gets map of all elements. | |
| WidgetElement * | GetElement (std::string name) |
| Gets specific element by name. | |
| Public Member Functions inherited from Tickable | |
| bool | isTicking () const |
| Checks if object is ticking. | |
| void | SetTicking (bool isEnabled) |
| Sets tick state for object. | |
| Public Member Functions inherited from UIElement | |
| Vector2 | GetScreenSize () const |
| Gets size of UI. | |
| void | SetScreenSize (const Vector2 &size) |
| Sets size of UI. | |
| Vector2 | GetScreenPosition () const |
| Gets screen position of UI. | |
| void | SetScreenPosition (const Vector2 &ScreenPosition) |
| Sets screen position of UI. | |
| void | AddScreenOffset (const Vector2 &offset) |
| Adds offset to UI position. | |
| bool | isVisible () const |
| Checks if UI is visible. | |
| void | SetVisibility (bool visibility) |
| Sets visibility of UI. | |
Additional Inherited Members | |
| Protected Member Functions inherited from Tickable | |
| virtual void | Tick (float dt) |
| Update tick event. | |
UI element that can be displayed on screen.
Definition at line 14 of file Widget.hpp.
| Widget::Widget | ( | std::string | UID | ) |
Constructs widget.
Put all class level functionality here (member initializations, default values, etc.)
| UID | Unique ID that identifies this widget |
Definition at line 7 of file Widget.cpp.
|
virtual |
Definition at line 29 of file Widget.cpp.
| std::string Widget::GetUID | ( | ) | const |
| ElemType * Widget::AddElement | ( | std::string | name | ) |
Creates and adds WidgetElement to widget screen.
| ElemType | Element class to add |
| name | Unique name of element |
Definition at line 54 of file Widget.hpp.
| const std::unordered_map< std::string, WidgetElement * > & Widget::GetAllElements | ( | ) | const |
Gets map of all elements.
Definition at line 18 of file Widget.cpp.
| WidgetElement * Widget::GetElement | ( | std::string | name | ) |
Gets specific element by name.
| name | name of element |
Definition at line 21 of file Widget.cpp.