Component:SnapLine: Difference between revisions

From Resonite Wiki
imported>Xekri
Created page with "<languages></languages> <translate> <!--T:1--> {{stub}} {{Infobox Component |Image=SnapLineComponent.png |Name=Snap Line }} <!--T:2--> == Fields == {{Table ComponentFields |P..."
 
add example
 
(2 intermediate revisions by 2 users not shown)
Line 2: Line 2:
<translate>
<translate>
<!--T:1-->
<!--T:1-->
{{stub}}
{{Infobox Component
{{Infobox Component
|Image=SnapLineComponent.png
|Image=SnapLineComponent.png
|Name=Snap Line
|Name=Snap Line
}}
}}
A snap line is a component that is able to generate a point in a line given a point by another component. Usually this is used in components like the [[Component:MultiUserAvatarAnchor|Multi User Avatar Anchor Component]] to determine where to place the anchors upon clicking (click point is used in such case) When provided a point, it finds the closest point on a line and returns that to the component that called it.
The functionality of this component is internal, and cannot be used by [[ProtoFlux]] to snap points using in game code.


<!--T:2-->
<!--T:2-->
== Fields ==
== Fields ==
{{Table ComponentFields
{{Table ComponentFields
|Point0|Float3|
|Point0|Float3| The first point to use to define the line
|Point1|Float3|
|Point1|Float3| the second point to define the line
|Anchor0|Slot|
|Anchor0|Slot| an override to use instead of Point0 to define the line
|Anchor1|Slot|
|Anchor1|Slot| an override to use instead of Point1 to define the line
|SnapParent|Slot|
|SnapParent|Slot| Where to put slots if the component is being used for slot placement.
}}
}}


<!--T:3-->
<!--T:3-->
== Usage ==
== Usage ==
Used as an anchor point generator in the [[Component:MultiUserAvatarAnchor|Multi User Avatar Anchor Component]] and drawing tools.


<!--T:4-->
<!--T:4-->
Line 27: Line 31:
== Related Components ==
== Related Components ==
</translate>
</translate>
[[Category:ComponentStubs]]
[[Category:Components{{#translation:}}|Snap Line]]
[[Category:Components{{#translation:}}|Snap Line]]
[[Category:Components:Transform:Snapping{{#translation:}}|Snap Line]]
[[Category:Components:Transform:Snapping{{#translation:}}|Snap Line]]

Latest revision as of 19:05, 29 February 2024

Component image 
Snap Line component as seen in the Scene Inspector

A snap line is a component that is able to generate a point in a line given a point by another component. Usually this is used in components like the Multi User Avatar Anchor Component to determine where to place the anchors upon clicking (click point is used in such case) When provided a point, it finds the closest point on a line and returns that to the component that called it.

The functionality of this component is internal, and cannot be used by ProtoFlux to snap points using in game code.


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.
Point0 Float3 The first point to use to define the line
Point1 Float3 the second point to define the line
Anchor0 Slot an override to use instead of Point0 to define the line
Anchor1 Slot an override to use instead of Point1 to define the line
SnapParent Slot Where to put slots if the component is being used for slot placement.

Usage

Used as an anchor point generator in the Multi User Avatar Anchor Component and drawing tools.

Examples

Related Components