UIUtils module
- Last UpdatedOct 21, 2025
- 2 minute read
The UIUtils module can be plugged into the Toolbar module, and it can also be used in isolation.
Setting Toolbar module to use UIUtils
The Toolbar module has the animatorScriptObjectName configuration field, whose default value is empty. However, when it's set to a non-empty string “uiUtils”, the toolbar will make use of the UIUtils module to animate the transitions in the UI.
When UIUtils module is added to a project, a ScriptObject named uiUtils is created. This class instance is then internally referenced by the Toolbar module itself and used to animate the UI elements.
See the Integration guide for further details.
Public interface
The public interface for the UIUtils module.
|
Name |
Input |
Description |
|---|---|---|
|
ChangeOpacity |
double opacity, double duration, string element, bool inherit, string callback |
Interpolates the transparency of a UI element, from the current value to the input opacity value, within a set duration. Input arguments are:
|
|
MoveToPosition |
vector2 finalPos, double duration, string element, string callback |
Interpolates the position of a UI element, from the current value to the target position value, within a set duration. Input arguments are:
If an element has children, position changes automatically propagate to them. |
|
Scale |
vector2 finalScale, double duration, string element, string callback |
Interpolates the scale of a UI element, from the current value to the inputscale value, within a set duration. Input arguments are:
If an element has children, scale changes automatically propagate to them. |
|
ShiftPosition |
vector2 addPos, double duration, string element, string callback |
Smoothly incrementing the current position of a UI element with a specified position delta, within a set duration. Input arguments are:
If an element has children, position changes automatically propagate to them. |