![]() |
vkmEngine 1.0.0
A C++ game engine · vkmengine.com
|
An interactive, hit-tested button drawn over its element's rect. More...
#include <ui_button.h>
Public Member Functions | |
| const glm::vec4 & | colorForState () const |
| The background tint for the current state. | |
Public Attributes | |
| UIShape | shape |
| Corners, edge and fade of the quad, whatever state colours it. | |
| std::string | eventId |
| Identifier carried by the UIClickEvent this button fires. | |
| bool | interactable = true |
| When false: drawn Disabled, ignores the pointer. | |
| bool | held = false |
| A press began on it and is still down, wherever the pointer is now. | |
| glm::vec2 | pointer = glm::vec2(0.0f) |
| In the element's reference pixels, from its top-left. | |
| glm::vec2 | resolvedSize = glm::vec2(0.0f) |
| The element's laid-out size, in the same pixels as pointer. | |
An interactive, hit-tested button drawn over its element's rect.
A press released over it enqueues a UIClickEvent carrying eventId; add a UIText on the entity for a label. Also the UI's one drag primitive: a slider is a button over its track reading pointer.x / resolvedSize.x while held.
|
inline |
The background tint for the current state.