You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Luke Mirman edited this page Sep 7, 2022
·
2 revisions
Aspect Ratio Calculator
The Aspect Ratio Calculator component can be added to canvas UI elements to update an attached Aspect Ratio Fitter's aspectRatio to fit the layout element's dimensions.
Usage
In the canvas hierarchy add the Aspect Ratio Fitter and Aspect Ratio Calculator to the game object to fit.
A. Note: The game object must have a layout element such as text, image, or other ILayoutElement component.
When the layout element has been modified use the RecalculateAspect(); method to update the Aspect Ratio Fitter's aspectRatio value