File uiElement.hpp¶
Defines
-
MAX_ELEMENTS¶
The maximum number of UI elements allowed in an InterfaceView.
Typedefs
-
typedef uint8_t ElementIndex¶
8-bit number representing a number identifier for an UIElement within an InterfaceView.
-
struct UIElement¶
- #include <uiElement.hpp>
A struct, representing an UI element in a View.
Subclassed by Button, ColorRect, ComboBox, DialogueArea, ImageRect, Label, NinePatchImageRect, TextBox, ValueSlider
Public Functions
-
UIElement()¶
Empty constructor.
-
UIElement(const std::string &typeName)¶
Constructor with a name for the element type. Shall be used by derived structs.
-
inline virtual ~UIElement()¶
Virtual destructor.
-
virtual void init()¶
Initialize the properties and callbacks.
-
virtual void config()¶
Routine to update the element after a property has been changed.
-
virtual void update() = 0¶
Update routine.
-
virtual void draw(Rectangle rect) = 0¶
Draw routine using a rect.
Public Members
-
std::unordered_map<std::string, ElementProperty> props = {}¶
A map of the properties of this element.
-
std::unordered_map<std::string, std::function<void()>> callbacks = {}¶
A map of the callbacks that this element has.
-
std::string typeName = ""¶
Name of the type of this UI element.
-
UIElement()¶