Button Events: Difference between revisions
Fixes, rewording & adding SHORTDESC. |
No edit summary |
||
Line 1: | Line 1: | ||
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|slot]], which is usually the same one it is attached to. Button events '''do not''' traverse hierarchies in the same way [[Dynamic Impulses]] do. | {{SHORTDESC:Button events are a generalized event system for all button interactions.}}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|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 (ProtoFlux)|Button Events node]]. | You can use button events in [[ProtoFlux]] by using the [[Button Events (ProtoFlux)|Button Events node]]. | ||
Line 178: | Line 178: | ||
| [[WorldThumbnailItem (Component)]] || Yes || Yes || | | [[WorldThumbnailItem (Component)]] || Yes || Yes || | ||
|} | |} | ||
Revision as of 20:04, 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 event originated 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 |