It would be good to have our main menu window appear smoothly with a gradual scale increase. We'll do that using tweens.
Tweening is the process of automatically generating intermediate values between two start
and end
values. You define the start
and end
values manually, and let the computer do the calculations to go from start
to end
, applying smoothing methods if requested.
Considering this concept, you can tween scale, position, rotation, and more. Indeed, if we needed to tween our window's scale from 0 to 1, we could simply tween the three X
, Y
, and Z
scale values, and the window will gradually become bigger until it reaches its final size.
With NGUI, we have a component to do just that—the Tween Scale
component.