|
| | Button (std::string text, Vector3 position=Vector3(0, 0, 0), Color foreColor=Colors::BLACK, Color hoverColor=Colors::GRAY, Color focusColor=Colors::DARK_GRAY, Color backgroundColor=Colors::WHITE) |
| | Constructs a button.
|
| |
| void | registerOnClickEvent (std::function< void(const MouseEvent *)> handler) |
| | Registers a callback invoked when the button is clicked.
|
| |
| void | setTexture (Texture *textureIn) |
| | Sets the button's background texture.
|
| |
| Texture * | getTexture () |
| | Returns the button's background texture.
|
| |
| | Label (std::string text="Label", Vector3 position=Vector3(0, 0, 80)) |
| | Constructs a label.
|
| |
| std::string | getText () |
| | Returns the current text.
|
| |
| Vector2 | getSize () |
| | Returns the rendered size of the text.
|
| |
| int | getFontHeight () |
| | Returns the font pixel height.
|
| |
| void | setText (std::string text) |
| | Sets the displayed text.
|
| |
| void | setFontHeight (int heightIn) |
| | Sets the font pixel height.
|
| |
| void | setColor (Color colorIn) |
| | Sets the text color.
|
| |
| void | setBackgroundColor (Color colorIn) |
| | Sets the background color behind the text.
|
| |
| TextRendererComponent * | getTextRendererComponent () |
| | Returns the underlying text renderer component.
|
| |
| | GameObject () |
| |
| virtual | ~GameObject () |
| |
| virtual void | onUpdate (double deltaTime) |
| | Per-frame update hook.
|
| |
| virtual void | onMouseEvent (const MouseEvent *e) |
| | Mouse event hook.
|
| |
| virtual void | onDisable () |
| | Called when the object becomes inactive.
|
| |
| virtual void | onEnable () |
| | Called when the object becomes active.
|
| |
| void | destroy () |
| | Marks the object for destruction by the ObjectManager.
|
| |
| template<typename T > |
| void | appendComponent (T *component) |
| | Attaches an existing component to this object.
|
| |
| template<typename T > |
| void | destroyComponent () |
| | Destroys and removes the first component of a type.
|
| |
| template<typename T > |
| T * | getComponent () |
| | Returns the first attached component of a type.
|
| |
| template<typename T > |
| std::vector< T * > | getComponents () |
| | Returns all attached components of a type.
|
| |
| template<typename T , typename... Args> |
| T * | newComponent (Args &&... args) |
| | Constructs a component in place and attaches it.
|
| |
| void | setActive (bool a) |
| | Activates or deactivates the object.
|
| |
| bool | isActive () |
| | Reports whether the object is active.
|
| |
Clickable button game object with a text label.
Extends Label with a ButtonComponent for hover/press visuals and lets callers register click handlers.