Component:Facet: Difference between revisions

From Resonite Wiki
Automated: create new component page
 
add much needed info
 
Line 3: Line 3:
|Name=Facet
|Name=Facet
}}
}}
{{stub}}
The '''Facet''' Component is the component that drives every user made [[Facets|facet]] in the game. This component specifically handles the sizes in which a facet can/can't, and prefers to be placed. It also reports the last size a facet was placed, the aspect ratio sizes it can be placed, and the [[Component:Canvas|Canvas]] that makes up the facet's contents.
 
When being placed into a spot, this facet finds the closest one of <code>PreferredSizes</code> that can be used while still fitting and automatically makes it the size when dropped in that spot. This only triggers if the user is just dropping it on their dash, as opposed to drag clicking the facet in.


== Usage ==
== Usage ==
{{Table ComponentFields
{{Table ComponentFields
|MinWidth|Float|
|MinWidth|Float| The minimum width this facet can be.
|MaxWidth|Float|
|MaxWidth|Float| The maximum width this facet can be.
|MinHeight|Float|
|MinHeight|Float| The minimum height this facet can be.
|MaxHeight|Float|
|MaxHeight|Float| The maximum height this facet can be.
|LastPlacedSize|'''[[Type:Nullable`1|Nullable`1]]&lt;[[Type:Float2|Float2]]&gt;'''|TypeAdv4=true|
|LastPlacedSize|'''[[Type:Nullable`1|Nullable`1]]&lt;[[Type:Float2|Float2]]&gt;'''|TypeAdv4=true| The last size that this Facet was placed as.
|PreferredSizes|{{RootFieldType|SyncFieldList`1|[[Type:Float2|Float2]]}}|TypeAdv5=true|
|PreferredSizes|{{RootFieldType|SyncFieldList`1|[[Type:Float2|Float2]]}}|TypeAdv5=true| A list of sizes this canvas prefers to be placed when being dropped onto a facet holder.
|AllowedAspectRatios|{{RootFieldType|SyncFieldList`1|[[Type:Float2|Float2]]}}|TypeAdv6=true|
|AllowedAspectRatios|{{RootFieldType|SyncFieldList`1|[[Type:Float2|Float2]]}}|TypeAdv6=true| A list of allowed ratios between width and height this facet allows when being placed, lest the placement guide turns red and prevents placement.
|IsStandalone|Bool|
|IsStandalone|Bool| Whether this facet has not been placed in a dash or otherwise and is out in free form space.
|Canvas|'''[[Component:Canvas|Canvas]]'''|TypeAdv8=true|
|Canvas|'''[[Component:Canvas|Canvas]]'''|TypeAdv8=true| The canvas being used for the visuals of this Facet.
}}
}}


== Behavior ==
== Usage ==
See [[Facets]].


== Examples ==
== Examples ==
See [[Facets]].


== See Also ==
== See Also ==
* [[Facets]]


[[Category:Components:Radiant UI{{#translation:}}|Facet]]
[[Category:Components:Radiant UI{{#translation:}}|Facet]]
[[Category:Components{{#translation:}}|Facet]]
[[Category:Components{{#translation:}}|Facet]]
[[Category:ComponentStubs]]

Latest revision as of 17:40, 22 December 2024

Component image 
Facet component as seen in the Scene Inspector

The Facet Component is the component that drives every user made facet in the game. This component specifically handles the sizes in which a facet can/can't, and prefers to be placed. It also reports the last size a facet was placed, the aspect ratio sizes it can be placed, and the Canvas that makes up the facet's contents.

When being placed into a spot, this facet finds the closest one of PreferredSizes that can be used while still fitting and automatically makes it the size when dropped in that spot. This only triggers if the user is just dropping it on their dash, as opposed to drag clicking the facet in.

Usage

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.
MinWidth Float The minimum width this facet can be.
MaxWidth Float The maximum width this facet can be.
MinHeight Float The minimum height this facet can be.
MaxHeight Float The maximum height this facet can be.
LastPlacedSize Nullable`1<Float2> The last size that this Facet was placed as.
PreferredSizes direct SyncFieldList`1<Float2> A list of sizes this canvas prefers to be placed when being dropped onto a facet holder.
AllowedAspectRatios direct SyncFieldList`1<Float2> A list of allowed ratios between width and height this facet allows when being placed, lest the placement guide turns red and prevents placement.
IsStandalone Bool Whether this facet has not been placed in a dash or otherwise and is out in free form space.
Canvas Canvas The canvas being used for the visuals of this Facet.

Usage

See Facets.

Examples

See Facets.

See Also