Button events provide a generalized system for buttons and actions triggered by buttons within Resonite.
This abstraction allows components to define behaviors as responses to common button interactions without having to know the specific button the interaction originates from.
When a button event sender component triggers an event, it will call all corresponding button event receiver components on a single target slot, which is usually the same one it is attached to. Button events do not traverse hierarchies in the same way Dynamic Impulses do.
You can use button events in ProtoFlux by using the Button Events node.
Event Types
Button events are separated into two categories, each defining 3 event types:
- Hover Events
- Hover Enter
- Hover Stay
- Hover Leave
- Press Events
- Pressed
- Pressing
- Released
Components that act as receivers for either or both of those event categories implement IButtonPressReceiver and IButtonHoverReceiver respectively.
Button Event Data
Each button event carries event data with information about the interaction the event originates from.
Property Name | Property Type |
---|---|
Source | Component |
Global Press Point | Float3 |
Local Press Point | Float2 |
Normalized Press Point | Float2 |
Button Event Senders
Component | Hover Events | Press Events | Notes |
---|---|---|---|
Button | Yes | Yes | |
ButtonHoverEventRelay | Yes | No | Relays button hover events to a specifiable slot instead of its own. |
ButtonPressEventRelay | No | Yes | Relays button press events to a specifiable slot instead of its own. |
LegacyButton | No | Yes | Only supports Pressed and Released, not Pressing. |
PhysicalButton | No | Yes | |
TouchButton | No | Yes |