Animation Object

Animations modify property values over time. They can be started automatically or manually, both with an optional delay. After the animation has run its course over the defined time period, it can stop, start over, or do the same but in reverse.

Animations attach the object being animated. The PropertyName property is set to a dotted property path, for example, "Opacity" and "Position.Y".

Properties

AttachObject

Attached object being animated.

PropertyName

Specifies the property on which the animation will be applied to.

AnimationValueType

Specifies the property value type on which the animation will be applied to. AnimationValueType can be Float, Color, Rect or Gradient.

Interpolation

Sets how the value controlled by the animation changes over time.

The type of the Interpolation property of an animation.

Determines how the rate at which the current value (or StartValue) of a property is changed to the destination value (StopValue) over time. On a graph plotting the value of a property the animation is applied to (using the TAnimation PropertyName property) one endpoint is represented by the start value at t=0. The other endpoint is the stop value at t=Duration seconds. Many different paths can connect these two points. The only requirement is that time keeps moving forward! TInterpolationType provides a variety of paths to choose from.

With a TInterpolationType of Linear, the value of the property changes linearly over time, and the path between our start and stop points is a straight line. This and other values for TInterpolationType are described below.

See the AttachTAnimation (Delphi) code example referenced at the bottom for the visual demonstration.

TInterpolationType can take one of the following values:

Value  Meaning  
Linear
 A linear interpolation. The property value this animation applies to changes constantly over time.
 
Quadratic
 A quadratic function is applied to the path between the start and stop points. The slope of the path is zero at the start point and increases constantly over time. A scalar is applied to the function to make the endpoint fall on the path.
 
Cubic
 The interpolation is of the form y = x**3. The slope of the path is zero at the start point and increases much faster than the quadratic function over the path.
 
Quartic
 The interpolation is of the form y = x**4. The slope of the path is zero at the start point and increases much faster than the quadratic function over the path.
 
Quintic
 The interpolation is of the form y = x**5. The slope of the path is zero at the start point and increases much faster than the quadratic function over the path.
 
Sinusoidal
 The interpolation is of the form y = sin(x). The slope of the path is zero at the start point and places the first inflexion of the sin curve (x=pi) at the stop point.
 
Exponential
 The interpolation is of the form y = e**x. The slope of the path is one at the start point and increase much faster than the quadratic function over the path.
 
Circular
 The path between the start and stop point for this interpolation is a quarter of a circle. The slope of the path is zero at the start point and verticle at the stop point.
 
Elastic
 The path follows a progressive sinusoidal geometric interpolation. The sinusoidal amplitude of the path can be smaller at the beginning and bigger at the end or vice-versa depending on the animation type (in / out).
 
Back
 The path does not follow a geometric interpolation. The value (y coordinate) increases, moving back toward the Start Value, but time (x value) must always move in a positive direction.
 
Bounce
 The path depicts a bouncing ball. The path is made up of circular curves with curvature away from the straight line that connects the start and stop points. These curves are connected by sharp points.

 
AnimationType

Sets how the interpolation for this animation is applied to the animated property.

Determines how the interpolation of an animation is applied. Use AnimationType to specify how the value of a property changes from its starting value to its ending value (StopValue). Imagine the graph of the quadratic function: y = x**2. The slope of the graph is zero at x = 0. That means that y changes very slowly near x = 0. As x increases, the slope gets steeper and steeper, meaning that y is changing faster and faster. x represents time in the animation, and y is the value of the property being animated.

With a AnimationType of In and a Interpolation of Quadratic, the value of the property that this animation is applied to (PropertyName) changes slowly near the starting point (equivalent to the quadradic function at x = 0). With a AnimationType of Out, change is slow near the endpoint. For a AnimationType of InOut, change is slow at both ends. The curve is mirrored about the center point and meets in the middle.

AnimationType can take one of the following values:

Value  Meaning
  
In    The curve that applies to the Interpolation for this animation starts at the starting value of the property animated.
 
Out     The curve that applies to the Interpolation for this animation starts at the ending value of the property animated and proceeds backwards to the starting value.
 
InOut    The curve that applies to the Interpolation for this animation starts at both the starting value and the ending value of the property animated and meets at the center point.
 

Duration

The amount of time (in seconds) to animate from the start value to the stop value.


Delay

The number of seconds to wait before starting the animation.

Delay is a real number representing the number of seconds to wait before starting the animation. This period of time is measured from the execution of the Start method or, if Enabled is True, the beginning of the runtime. If Loop is True, the delay is only applied at the beginning of the animation.


AutoReverse

Animates backwards after animating forwards.

Set AutoReverse to True to animate the controlled property backwards, from the StopValue to the StartValue, after the completion of the regular animation. The forward and backward animations each take a Duration number of seconds. If Loop is True, the forward and backward animations are alternated. OnFinish gets called after the backward animation has completed.


Inverse

Animates backwards instead of forwards.

Set Inverse to True to animate the controlled property backwards from the StopValue to the StartValue. The backward animation takes a Duration number of seconds. OnFinish gets called after the backward animation has completed.


Loop

Repeats the animation indefinitely.

Set Loop to True to repeat the animation indefinitely from the StartValue to the StopValue. The OnFinish event handler never gets called when Loop is True.


StartFromCurrent

Starts the animation of this property from its current value.

If StartFromCurrent is True, set the StartValue property to the current value of the attached controlled property to start the animation from there.


Trigger

The state of a property of the attached object used to start the animation.


TriggerInverse

The state of a property of the attached object used to start the inverse of the animation.


Enabled

Starts the animation during the initialization of the runtime.

Set Enabled to True to start the animation immediately after the animation instance is created and attached to an object. Set Enabled to False to stop the animation.


FloatStart

Starts the animation of this property from this value.

For a FloatAnimation, StartValue is a Single real number containing the value to start animating the controlled property from. If StartFromCurrent is True, StartValue is reassigned to the current value of the property when the animation starts.


FloatStop

Terminate the animation of this property when it reaches this value.

The animation of the controlled property's value completes at the value of StopValue. If Stop is called before the Duration seconds have finished, the value of the property jumps to the StopValue value.


ColorStart

Starts the animation of this property from this value.

For a ColorAnimation, StartValue is a color value containing the value to start animating the controlled property from. If StartFromCurrent is True, StartValue is reassigned to the current value of the property when the animation starts.


ColorStop

Terminates the animation of this property when it reaches this value.

The animation of the controlled property's value completes at the value of StopValue. If Stop is called before the Duration seconds have finished, the value of the property jumps to the StopValue value.


RectValue

Start and stop values for RectAnimation.


GradientValue

Start and stop values for GradientAnimation.


Actions

Actions will be done on animation finished.