Component:AspectRatioFitter: Difference between revisions

From Resonite Wiki
m ProbablePrime moved page AspectRatioFitter (Component) to Component:AspectRatioFitter: Creating component Namespace
Added a description, added field descriptions, added usage a description.
 
(One intermediate revision by one other user not shown)
Line 2: Line 2:
<translate>
<translate>
<!--T:1-->
<!--T:1-->
{{stub}}
{{Infobox Component
{{Infobox Component
|Image=AspectRatioFitterComponent.png
|Image=AspectRatioFitterComponent.png
Line 9: Line 8:


<!--T:2-->
<!--T:2-->
== Intoduction ==
The '''AspectRatioFitter''' component makes the contents (child [[Slot|slots]]) of the [[Component:RectTransform|RectTransform]] stay the same dimensions (or the same ratio), even when the canvas or [[UIX]] element this component is in changes size.


<!--T:3-->
<!--T:3-->
== Usage ==
{{Table ComponentFields
{{Table ComponentFields
|AspectRatio|Float|  
|AspectRatio|Float|The aspect ratio of this UIX element. <code>1</code> is a perfect square, less than <code>1</code> is a vertical ratio, greater than <code>1</code> is a horizontal ratio.
}}
}}


<!--T:4-->
<!--T:4-->
== Behavior ==
== Usage ==
Great for keeping things more uniform by a ratio.


<!--T:5-->
<!--T:5-->
Line 26: Line 25:
== Related Components ==
== Related Components ==
</translate>
</translate>
[[Category:Components{{#translation:}}|AspectRatioFitter (Component){{#translation:}}]]
[[Category:Components{{#translation:}}|Aspect Ratio Fitter]]
[[Category:ComponentStubs]]
[[Category:Components:UIX:Layout{{#translation:}}|Aspect Ratio Fitter]]
[[Category:Components:UIX:Layout{{#translation:}}|AspectRatioFitter (Component){{#translation:}}]]

Latest revision as of 21:34, 28 July 2024

Component image 
AspectRatioFitter component as seen in the Scene Inspector


The AspectRatioFitter component makes the contents (child slots) of the RectTransform stay the same dimensions (or the same ratio), even when the canvas or UIX element this component is in changes size.

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.
AspectRatio Float The aspect ratio of this UIX element. 1 is a perfect square, less than 1 is a vertical ratio, greater than 1 is a horizontal ratio.

Usage

Great for keeping things more uniform by a ratio.

Examples

Related Components