Component:ButtonValueActionTrigger: Difference between revisions

From Resonite Wiki
Automated: create new component page
 
Add info
 
Line 3: Line 3:
|Name=Button Value Action Trigger`1
|Name=Button Value Action Trigger`1
}}
}}
{{stub}}
The '''ButtonValueActionTrigger''' component receives any [[Button Event]] and uses it to trigger a [[Sync Delegate]] and sends a value to it.


== Usage ==
== Fields ==
{{Table ComponentFields
{{Table ComponentFields
|OnPressed|{{RootFieldType|SyncDelegate`1|[[Type:Action`1|Action`1]]<T>}}|TypeAdv0=true|
|OnPressed|{{RootFieldType|SyncDelegate`1|[[Type:Action`1|Action`1]]&lt;T&gt;}}|TypeAdv0=true| triggers while sending <code>Value</code> when this component receives a [[Button Event]] of type OnPressed.
|OnPressing|{{RootFieldType|SyncDelegate`1|[[Type:Action`1|Action`1]]&lt;T&gt;}}|TypeAdv1=true|
|OnPressing|{{RootFieldType|SyncDelegate`1|[[Type:Action`1|Action`1]]&lt;T&gt;}}|TypeAdv1=true| triggers while sending <code>Value</code> when this component receives a [[Button Event]] of type OnPressing.
|OnReleased|{{RootFieldType|SyncDelegate`1|[[Type:Action`1|Action`1]]&lt;T&gt;}}|TypeAdv2=true|
|OnReleased|{{RootFieldType|SyncDelegate`1|[[Type:Action`1|Action`1]]&lt;T&gt;}}|TypeAdv2=true| triggers while sending <code>Value</code> when this component receives a [[Button Event]] of type OnReleased.
|Value|'''T'''|TypeAdv3=true|
|Value|'''T'''|TypeAdv3=true| The value to send to any <code>OnPressed</code>, <code>OnPressing</code>, and/or <code>OnReleased</code>.
}}
}}


== Behavior ==
== Usage ==
Attach to a slot with a button, or a slot targeted by a [[Component:ButtonRelay]] or related. Then, find a [[Sync Delegate]] to trigger using this component. Lastly, put the sync delegate into any <code>OnPressed</code>, <code>OnPressing</code>, and/or <code>OnReleased</code>; then provide <code>Value</code>


== Examples ==
== Examples ==


== See Also ==
== See Also ==
* [[Component:ButtonRelay]]
* [[Button Events]]
* [[Sync Delegates]] <- To learn what they are and how to find them.


[[Category:Components:Common UI:Button Interactions{{#translation:}}|Button Value Action Trigger`1]]
[[Category:Components:Common UI:Button Interactions{{#translation:}}|Button Value Action Trigger`1]]
[[Category:Components{{#translation:}}|Button Value Action Trigger`1]]
[[Category:Components{{#translation:}}|Button Value Action Trigger`1]]
[[Category:Generic Components{{#translation:}}|Button Value Action Trigger`1]]
[[Category:Generic Components{{#translation:}}|Button Value Action Trigger`1]]
[[Category:ComponentStubs]]

Latest revision as of 15:21, 11 November 2024

Component image 
Button Value Action Trigger`1 component as seen in the Scene Inspector

The ButtonValueActionTrigger component receives any Button Event and uses it to trigger a Sync Delegate and sends a value to it.

Fields

Fields
Name Type Description
persistent Bool Determines whether or not this item will be saved to the server.
UpdateOrder Int Controls the order in which this component is updated.
Enabled Bool Controls whether or not this component is enabled.
OnPressed Action`1<T> triggers while sending Value when this component receives a Button Event of type OnPressed.
OnPressing Action`1<T> triggers while sending Value when this component receives a Button Event of type OnPressing.
OnReleased Action`1<T> triggers while sending Value when this component receives a Button Event of type OnReleased.
Value T The value to send to any OnPressed, OnPressing, and/or OnReleased.

Usage

Attach to a slot with a button, or a slot targeted by a Component:ButtonRelay or related. Then, find a Sync Delegate to trigger using this component. Lastly, put the sync delegate into any OnPressed, OnPressing, and/or OnReleased; then provide Value

Examples

See Also