Component:TouchEventRelay: Difference between revisions

From Resonite Wiki
imported>Kazu
mNo edit summary
 
add info
 
(6 intermediate revisions by 4 users not shown)
Line 1: Line 1:
<languages></languages>
<languages></languages>
<translate>
<translate>
<!--T:1-->
Apparently, TouchEventRelay can relay events from a Touchable element to fire another ITouchable component.
{{Infobox Component
{{Infobox Component
|Image=TouchEventRelayComponent.png
|Image=TouchEventRelayComponent.png
|Name=Touch Event Relay
|Name=Touch Event Relay
}}
}}
The '''TouchEventRelay''' component is used to relay touch events recieved by a slot to other ITouchables.


<!--T:2-->
== Fields ==
== Fields ==
{{Table ComponentFields
{{Table ComponentFields
|Touched|WorldDelegate|
|Touched|{{RootFieldType|SyncDelegate`1|[[Type:TouchEvent|TouchEvent]]}}|TypeAdv0=true| The sync delegate to call when this receives a touch event.
|AcceptOutOfSightTouch|Bool|
|AcceptOutOfSightTouch|Bool| Whether this component allows touch events from a user not looking directly at the slot with this component.
|TouchableTargets|SyncRefList`1|TypeString2=SyncRefList<ITouchable>|
|TouchableTargets|{{RootFieldType|SyncRefList`1|[[Type:ITouchable|ITouchable]]}}|TypeAdv2=true| Target touchable components to send the touch event to.
}}
}}


<!--T:3-->
== Usage ==
== Usage ==
*To Use hyperlink item without touchable/interactable component: Use TouchEventRelay. You put that on the top of your object, then put the hyperlink and other touchables as children (with no colliders on them) and add them to the list of "TouchableTargets" of the TouchEventRelay. [https://discord.com/channels/402159838827905024/477711742001086505/721967459262791730| Discord]
*To trigger a hyperlink component without a touchable/interactable component you can use a TouchEventRelay. You a touch event relay on the collider of your object, then put a hyperlink or other touchables as children (with no colliders on them) then add them to the TouchableTargets list of the TouchEventRelay.
== Examples ==
== Examples ==
* [https://www.youtube.com/watch?v=5n2veHi-CJU Using TouchEventRelay for complicated Touch Events] by [[User:ProbablePrime|ProbablePrime]]
* [https://www.youtube.com/watch?v=5n2veHi-CJU Using TouchEventRelay for complicated Touch Events] by [[User:ProbablePrime|ProbablePrime]]


<!--T:5-->
== Related Components ==
== Related Components ==
* [[Touchable_Events_(LogiX_node)]] Needs to be used with TouchEventRelay under Transform/Interaction) [https://discord.com/channels/402159838827905024/469131434628612116/655778555594014740| Discord]
* [[ProtoFlux:Touchable Events|Touchable Events]] can be used with TouchEventRelay.
TouchEventRelay can relay events from a Touchable element to fire another ITouchable component.
 
</translate>
</translate>
[[Category:Components{{#translation:}}|Touch Event Relay]]
[[Category:Components{{#translation:}}|Touch Event Relay]]
[[Category:Components:Transform:Interaction{{#translation:}}|Touch Event Relay]]
[[Category:Components:Transform:Interaction{{#translation:}}|Touch Event Relay]]

Latest revision as of 11:55, 3 August 2025

Component image 
Touch Event Relay component as seen in the Scene Inspector

The TouchEventRelay component is used to relay touch events recieved by a slot to other ITouchables.

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. Some components stop their functionality when this field is disabled, but some don't.
Touched delegate of identity TouchEvent The sync delegate to call when this receives a touch event.
AcceptOutOfSightTouch Bool Whether this component allows touch events from a user not looking directly at the slot with this component.
TouchableTargets list of ITouchable Target touchable components to send the touch event to.

Usage

  • To trigger a hyperlink component without a touchable/interactable component you can use a TouchEventRelay. You a touch event relay on the collider of your object, then put a hyperlink or other touchables as children (with no colliders on them) then add them to the TouchableTargets list of the TouchEventRelay.

Examples

Related Components

TouchEventRelay can relay events from a Touchable element to fire another ITouchable component.