Button Events: Difference between revisions
Tweaked text formatting |
Renamed Handler -> Receiver |
||
Line 51: | Line 51: | ||
|} | |} | ||
== Button Event | == Button Event Receivers == | ||
{| class="wikitable" style="margin:left" | {| class="wikitable" style="margin:left" | ||
|- | |- |
Revision as of 20:21, 18 January 2024
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 (Component) | Yes | Yes | |
ButtonHoverEventRelay (Component) | Yes | No | Relays button hover events to a specifiable slot instead of its own. |
ButtonPressEventRelay (Component) | No | Yes | Relays button press events to a specifiable slot instead of its own. |
LegacyButton (Component) | No | Yes | Only supports Pressed and Released, not Pressing. |
PhysicalButton (Component) | No | Yes | |
TouchButton (Component) | No | Yes |