Inherited: Animation


This class allows to change values in time. VariantAnimation uses key-frame animation mechanism. Developers should specify sequence of key values which pair of point in time and key value. While animation is playing specific interpolation function moves from one key-frame to another and changing controled value.

List of supported Variant types for animation:

MetaType::BOOLEAN MetaType::INTEGER MetaType::FLOAT MetaType::VECTOR2 MetaType::VECTOR3 MetaType::VECTOR4

Public Methods


currentValue () const


duration () const


setCurrentTime (int position)


setCurrentValue (const Variant & value)


setCurve (AnimationCurve * curve, int32_t component = 0)


setDuration (int32_t duration)

Static Methods


Methods Description

Variant VariantAnimation::currentValue () const

Returns the current value for the animated Variant.

See also setCurrentValue().

int32_t VariantAnimation::duration () const

Reimplements: Animation::duration() const.

Returns the duration of the animation (in milliseconds).

See also setDuration().

void VariantAnimation::setCurrentTime (int position)

This is an overloaded function.

This function interpolates animated Variant value from one KeyFrame to another at position in milliseconds.

void VariantAnimation::setCurrentValue (Variant & value)

Sets the new current value for the animated Variant.

See also currentValue().

void VariantAnimation::setCurve (AnimationCurve * curve, int32_t component = 0)

Sets the new sequence of the key frames as curve for the provided component.

void VariantAnimation::setDuration (int32_t duration)

Sets a new duration of the animation in milliseconds.

See also *duration*().