The UI Assistant’s scale settings and components allow you to scale parts of your UI – with the ability to scale texts separately – based on predefined minimum and maximum values.
The Rect Transform Scaler requires a Rect Transform component, and automatically updates its X and Y scale, or, its width and height, based on the active Scale Profile, and its current interpolation value.
When Scaling Mode is set to Scale, this component should only be added to Game Objects whose Rect Transforms’ scale won’t be manipulated by any other component.
Property whose selected axes will be multiplied based on the active Scale Profile.
Determines which axes will be affected when Scaling Mode is set to Scale.
Keeps the Rect Transform's edges in their original position.
Determines which axes will be affected when Scaling Mode is set to Size.
Updates the Rect Transform's scale or size based on the Scale Settings.
The Sliced Image Scaler adjusts its required Image component’s Pixels Per Unity Multiplier to the active Scale Profile, and its current interpolation value. It is recommended to add this component to UI elements that have outlines, and use the Rect Transform Scaler with Scaling Mode set to Size. When an Image’s size changes, it will – by default – retain its Pixels Per Unity Multiplier, and will therefore look different compared to Images whose scale is adjusted by the Rect Transform Scaler.
The Image component’s Image Type must be set to Sliced to enable scaling. The Sliced Image Scaler only displays a message or a warning, letting you know if it will or will not have any effect on the Game Object’s visuals.
As an extension of the Layout Element, the Scaling Layout Element automatically adjusts Min Width, Min Height, Preferred Width, and Preferred Height values to the active Scale Profile, and its current interpolation value.
The Scaling Layout Element looks and functions the same way as its base counterpart.
As extensions of the Horizontal and Vertical Layout Groups, the Scaling Horizontal and Vertical Layout Groups allow Padding and Spacing values to automatically adjust to the active Scale Profile, and its current interpolation value. They look and function the same way as their base counterparts.
The Stretching Grid Layout Group is an extension of the Grid Layout Group that can calculate the Cell Size value for you, based on your preference. Its primary purpose is to automatically stretch the cells to fill the bounds of the Rect Transform, while taking Padding and Spacing into consideration.
Just like Scaling Horizontal and Vertical Layout Groups, this component can also update Padding and Spacing values based on the active Scale Profile, and its current interpolation value.
When Stretch Cells is toggled off, the component functions exactly like a Grid Layout Group. To enable automatic Cell Size calculation, check the Stretch Cells box, select the Constraint type, and set the following values that will appear based on your selection.
When Constraint is set to Flexible, the component will try to match your Preferred Cell Size by setting Cell Size to a value closest to your preference.
When Constraint is set to Expanded, the component will allow you to set the width-to-height ratio of your cells. Setting the Match slider to the Width end (0) will make the cells stretch across the Rect Transform’s width (minus Left and Right Padding), whereas setting it to the Height end (1) will make them match its height (minus Top and Bottom Padding).
The Match slider allows you to turn a Grid Layout Group into a Horizontal or Vertical Layout Group – at least visually.
While an Expanded Constraint will fit all children of the Rect Transform (that doesn’t have a Layout Element with Ignore Layout set to true) into the layout, Fixed Cell Count allows you to set the number of cells that should appear within its bounds. If there are more children, however, they will appear outside the Rect Transform’s bounds.
When Constraint is set to Fixed Column Count, Cell Size will be calculated based on the number of columns the layout should be divided into (Constraint Count), and the preferred height of each cell.
The Stretching Grid Layout Group will, as always, try to match the Cell Size as closely as possible based on these preferences, while considering the Rect Transform’s size, as well as Padding and Spacing values.
The Fixed Row Count Constraint type is the same as Fixed Column Count, but rotated by 90 degrees. Horizontal and vertical values are swapped; Constraint Count refers to the number of rows division will be based on, and cells’ preferred width will be matched as closely as possible.
The Fixed Row And Column Count setting is similar to Fixed Cell Size, but works with an X and Y Constraint Count instead of the Match slider.
Padding, spacing and cell size will be multiplied based on the active Scale Profile.
Expand cells to match the Rect Transform's boundaries, minus padding and spacing.
A mode used to stretch cells.
A single cell's preferred size the layout will try to match.
Determines if the scaling is using the width or height as reference, or a mix in between.
The number of columns and/or rows.
The preferred height of each row the layout will try to match.
The preferred width of each column the layout will try to match.
Updates spacing and padding values, as well as cell size based on the Scale Settings.
Returns the maximum number of items that can fit into the layout's bounds.
Returns the current number of items contained within the layout's bounds.
Returns the current number of items contained by the layout, including items outside its bounds.
The Scale Settings window can be opened via the “Tools/UI Assistant” menu, or, by clicking on the “Open Scale Settings” button at the bottom of related components.
A list of Scale Profiles added to the Scale Settings asset. This is handled by the Scale Settings editor; please do not add or remove any Scale Profiles yourself.
The interpolation value between the active Scale Profile's Min and Max Scale Multiplier values.
The interpolation value between the active Scale Profile's Min and Max Font Size Increase, as well as Min and Max Font Size Multiplier values.
The value used to multiply Scaleables' values.
The value used to multiply Text Stylers' font sizes.
The value used to increase Text Stylers' font sizes.
The ScaleSettings script includes several public methods used by components automatically, or the Scale Settings editor window. It is recommended to only use the methods listed below.
Sets the designated Scale Profile as the active Scale Profile, and updates all Scaleables and Text Stylers based on interpolation values, in combination with the new active Scale Profile's minimum and maximum values.
Determines the values used to update Scaleables, based on the active Scale Profile's minimum and maximum values.
Determines the values used to update Text Stylers, based on the active Scale Profile's minimum and maximum values.
The active Scale Profile whose values will determine Scaleables' and Text Stylers' SetScale results.
The index of the active Scale Profile, based on the order of Scale Profiles set within the Scale Settings.
Returns an array of Scale Profile names listed in the Scale Settings.
Scale Profiles contain data used by Rect Transform Scalers, Scaling Horizontal Layout Groups, Scaling Vertical Layout Groups, Stretching Grid Layout Groups, Scaling Layout Elements, Sliced Image Scalers, and Text Stylers to set values that influence the size of your UI. While it is possible to create several Scale Profiles, only one of them can be active at any given time. Active Scale Profile can be changed during runtime, updating all relevant components.
Click on the “Edit” button (gear icon) next to a Scale Profile to open its editor, or, click on the “New Scale Profile” button to create a new one – this will automatically open the editor.
Each Scale Profile value has a minimum and maximum end, used for linear interpolation to determine the multiplier used by the components listed above.
The name of the asset.
The value used to multiply scales when the interpolation value is set to 0. Cannot be lower than 0.01.
The value used to multiply scales when the interpolation value is set to 1. This value can exceed 1.
The value used to increase font sizes when the interpolation value is set to 0.
The value used to increase font sizes when the interpolation value is set to 1.
The value used to multiply font sizes when the interpolation value is set to 0. Cannot be lower than 0.01.
The value used to multiply font sizes when the interpolation value is set to 1. This value can exceed 1.