Unity-UI-Extensions.GitHub.io

UI_TweenScale

Dynamic scaling of text or image (including button) based on curves


Contents

1 Overview

2 Properties

3 Methods

4 Usage

5 Video Demo

6 See also

7 Credits and Donation

8 External links


Overview

A simplified control for adding programmatic scaling animation to any UI component, including buttons.

Notes


Properties

The properties of the UI TweenScale control are as follows:

Property Description
AnimCurve Animation curve for scale (if isUniform set to false, will apply only to X scale)
Speed Animation speed
IsLoop Animation will play infinitely (in order to make it work set your animation curve to loop)
PlayAtAwake Starts automatically with script becoming active. Otherwise you need to call Play() method.
IsUniform If false animCurve will modify object X scale and animCurveY - Y scale.
AnimCurveY Y Animation curve for non-uniform scale

Methods

Method Arguments Description
Play N/A Start the animation
ResetTween N/A Stop and reset the animation

Usage

Simply add the component to an existing RectTransform and configure the desired animation style. Then call the “Play” method in code or via a Unity UI Event (such as a button OnClick method)


Video Demo


See also

N/A


Credits and Donation


Sourced From