Component:ObjectGridAligner: Difference between revisions

From Resonite Wiki
m ProbablePrime moved page ObjectGridAligner (Component) to Component:ObjectGridAligner: Creating component Namespace
Automated: update Fields
 
(3 intermediate revisions by 2 users not shown)
Line 2: Line 2:
<translate>
<translate>
<!--T:1-->
<!--T:1-->
{{stub}}
{{Infobox Component
{{Infobox Component
|Image=ObjectGridAlignerComponent.png
|Image=ObjectGridAlignerComponent.png
|Name=Object Grid Aligner
|Name=Object Grid Aligner
}}
}}
The '''ObjectGridAligner''' component aligns objects into a grid of items with x number of items per row.


<!--T:2-->
<!--T:2-->
== Fields ==
== Fields ==
{{Table ComponentFields
{{Table ComponentFields
|AutoAddChildren|Bool| Controls whether slots below this component's slot in the hierarchy are automatically added to <code>_targets</code>
|AutoAddChildren|Bool| Controls whether slots below this component's slot in the hierarchy are automatically added to <code>_targets</code>.
|ItemsPerRow|Int|
|AutoAddIgnoreTags|{{RootFieldType|SyncFieldList`1|[[Type:String|String]]}}|TypeAdv1=true|
|CellSize|Float2|
|ItemsPerRow|Int| How many items per row.
|LerpSpeed|Float|
|CellSize|Float2| The space between each item.
|HorizontalAlignment|Align|
|LerpSpeed|Float| How fast the items should move to align themselves in the specified grid arrangement.
|VerticalAlignment|Align|
|HorizontalAlignment|'''[[#Align|ObjectGridAligner.Align]]'''|TypeAdv5=true| How to align the items horizontally.
|RowAxis|AxisDir|
|VerticalAlignment|'''[[#Align|ObjectGridAligner.Align]]'''|TypeAdv6=true| How to align the items vertically.
|ColumnAxis|AxisDir|
|RowAxis|'''[[#AxisDir|ObjectGridAligner.AxisDir]]'''|TypeAdv7=true| The axis that items should be aligned on for the horizontal axis of the grid.
|Items|SyncList`1|TypeString8=SyncList<Item>|
|ColumnAxis|'''[[#AxisDir|ObjectGridAligner.AxisDir]]'''|TypeAdv8=true| The axis that items should be aligned on for the vertical axis of the grid.
|Items|{{RootFieldType|SyncList`1|[[#Item|ObjectGridAligner.Item]]}}|TypeAdv9=true| A list of items who's positions should be driven to place them into a grid alignment using this component's calculations.
}}
 
== Align ==
{{stub}}
Controls how the items should align themselves along the axis specified by the component.
{{Table EnumValues
|Neg|0| Aligns items so their values are always negative along the specified alignment axis (so if using x axis, x will always be negative for an item)
|Mid|1| Aligns items so half are on the negative and half are on the positive along an axis, so they take up both directions equally.
|Pos|2| Aligns items so their values are always positive along the specified alignment axis (so if using x axis, x will always be positive for an item)
}}
 
== AxisDir ==
{{stub}}
{{Table EnumValues
|Xpos|0| Align items along the positive x axis.
|Xneg|1| Align items along the negative x axis.
|Ypos|2| Align items along the positive y axis.
|Yneg|3| Align items along the negative y axis.
|Zpos|4| Align items along the positive z axis.
|Zneg|5| Align items along the negative z axis.
}}
 
== Item ==
{{Table TypeFields
|Root|Slot| The slot to align.
|PositionDrive|{{RootFieldType|FieldDrive`1|[[Type:Float3|Float3]]}}|TypeAdv1=true| The position field of <code>Root</code>.
}}
}}


<!--T:3-->
<!--T:3-->
== Usage ==
== Usage ==
Can be used for aligning tiles, shelves, boxes, or anything that needs consistent alignment.


<!--T:4-->
<!--T:4-->
Line 30: Line 58:


<!--T:5-->
<!--T:5-->
== Related Components ==
== See Also ==
</translate>
</translate>
[[Category:ComponentStubs]]
[[Category:Components{{#translation:}}|Object Grid Aligner]]
[[Category:Components{{#translation:}}|Object Grid Aligner]]
[[Category:Components With Nested Enums{{#translation:}}|Object Grid Aligner]]
[[Category:Components With Nested Types{{#translation:}}|Object Grid Aligner]]
[[Category:Components:Transform:Drivers{{#translation:}}|Object Grid Aligner]]
[[Category:Components:Transform:Drivers{{#translation:}}|Object Grid Aligner]]

Latest revision as of 06:03, 17 March 2025

Component image 
Object Grid Aligner component as seen in the Scene Inspector

The ObjectGridAligner component aligns objects into a grid of items with x number of items per row.

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.
AutoAddChildren Bool Controls whether slots below this component's slot in the hierarchy are automatically added to _targets.
AutoAddIgnoreTags direct SyncFieldList`1<String>
ItemsPerRow Int How many items per row.
CellSize Float2 The space between each item.
LerpSpeed Float How fast the items should move to align themselves in the specified grid arrangement.
HorizontalAlignment ObjectGridAligner.Align How to align the items horizontally.
VerticalAlignment ObjectGridAligner.Align How to align the items vertically.
RowAxis ObjectGridAligner.AxisDir The axis that items should be aligned on for the horizontal axis of the grid.
ColumnAxis ObjectGridAligner.AxisDir The axis that items should be aligned on for the vertical axis of the grid.
Items list of ObjectGridAligner.Item A list of items who's positions should be driven to place them into a grid alignment using this component's calculations.

Align

This article or section is a Stub. You can help the Resonite Wiki by expanding it. Controls how the items should align themselves along the axis specified by the component.

Values
Name Value Description
Neg 0 Aligns items so their values are always negative along the specified alignment axis (so if using x axis, x will always be negative for an item)
Mid 1 Aligns items so half are on the negative and half are on the positive along an axis, so they take up both directions equally.
Pos 2 Aligns items so their values are always positive along the specified alignment axis (so if using x axis, x will always be positive for an item)

AxisDir

This article or section is a Stub. You can help the Resonite Wiki by expanding it.

Values
Name Value Description
Xpos 0 Align items along the positive x axis.
Xneg 1 Align items along the negative x axis.
Ypos 2 Align items along the positive y axis.
Yneg 3 Align items along the negative y axis.
Zpos 4 Align items along the positive z axis.
Zneg 5 Align items along the negative z axis.

Item

Fields
Name Type Description
Root Slot The slot to align.
PositionDrive field drive of Float3 The position field of Root.

Usage

Can be used for aligning tiles, shelves, boxes, or anything that needs consistent alignment.

Examples

See Also