Button Events: Difference between revisions
Fixed grammar |
More grammar tweaks |
||
Line 3: | Line 3: | ||
You can use button events in [[ProtoFlux]] by using the [[Button Events (ProtoFlux)|Button Events node]]. | You can use button events in [[ProtoFlux]] by using the [[Button Events (ProtoFlux)|Button Events node]]. | ||
{{Note|The order in which multiple button event | {{Note|The order in which multiple button event receiver components on the same slot are executed is not defined, as the order of components on a slot itself isn't defined and may change. If order of execution is important, consider using ProtoFlux instead!|danger}} | ||
== Event Types == | == Event Types == | ||
Line 19: | Line 19: | ||
== Button Event Data == | == Button Event Data == | ||
Each button event carries event data with information about the interaction the event | Each button event carries event data with information about the interaction the event originates from. | ||
{| class="wikitable" style="margin:left" | {| class="wikitable" style="margin:left" | ||
|- | |- |
Revision as of 20:14, 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 |