Template class for from-to animations. More...
#include <kanzi/animation/from_to_animation.hpp>
Public Member Functions | |
optional< TValueType > | getFrom () const |
void | setFrom (optional< TValueType > from) |
bool | hasFrom () const |
optional< TValueType > | getTo () const |
void | setTo (optional< TValueType > to) |
bool | hasTo () const |
void | setDuration (chrono::milliseconds duration) |
TEasingFunction | getEasingFunction () const |
void | setEasingFunction (TEasingFunction easingFunction) |
void | setEasingMode (AnimationEasingMode mode) |
AnimationEasingMode | getEasingMode () const |
virtual TValueType | getValue (const TValueType ¤tValue, chrono::milliseconds time) KZ_OVERRIDE |
Returns new animated value given current value and time. More... | |
![]() | |
virtual | ~AbstractAnimation () |
Destructor. More... | |
optional< chrono::milliseconds > | getDuration () |
Returns the duration of the animation. More... | |
![]() | |
Object (Domain *domain) | |
virtual | ~Object () |
Domain * | getDomain () const |
Returns the domain the object belongs to. More... | |
KzuPropertyManager * | getPropertyManager () const |
Returns the property manager of the object. More... | |
KzuTaskScheduler * | getTaskScheduler () const |
Returns the task scheduler of the object. More... | |
KzuMessageDispatcher * | getMessageDispatcher () const |
Returns the message dispatcher of the object. More... | |
ResourceManager * | getResourceManager () const |
Returns the resource manager of the object. More... | |
virtual const Metaclass * | getDynamicMetaclass () const |
Returns the metaclass of the dynamic type of the object. More... | |
bool | isTypeOf (const Metaclass *objectType) const |
Determines if the type of this object is the given type or derived from it. More... | |
template<typename DataType > | |
void | setProperty (const PropertyType< DataType > &propertyType, typename PropertyType< DataType >::DataType value) |
Sets the local value of a property. More... | |
void | setProperty (const PropertyType< ResourceID > &propertyType, ResourceSharedPtr value) |
Sets the local value of a resource id property with a resource pointer. More... | |
template<typename DataType > | |
DataType | getProperty (const PropertyType< DataType > &propertyType) const |
Returns the current value of a property. More... | |
template<typename DataType > | |
bool | getProperty (const PropertyType< DataType > &propertyType, typename PropertyType< DataType >::DataType &value) const |
Evaluates the property value in the same way as the overload above but does not default to the value in property metadata if there are no inputs to the property value. More... | |
template<typename DataType > | |
void | setAbstractProperty (AbstractPropertyType abstractPropertyType, typename PropertyType< DataType >::DataType value) |
void | setAbstractProperty (AbstractPropertyType abstractPropertyType, ResourceSharedPtr value) |
template<typename DataType > | |
DataType | getAbstractProperty (AbstractPropertyType abstractPropertyType) const |
template<typename DataType > | |
bool | getAbstractProperty (AbstractPropertyType abstractPropertyType, typename PropertyType< DataType >::DataType &value) const |
bool | hasValue (AbstractPropertyType propertyType) const |
Evaluates whether there are any inputs into the property value. More... | |
bool | hasLocalValue (AbstractPropertyType propertyType) const |
Evaluates whether there is a local value set for the property. More... | |
void | removeLocalValue (AbstractPropertyType propertyType) |
Removes the local value associated with the property. More... | |
void | copyLocalValues (const Object &other) |
Copies all local values from another object. More... | |
virtual void | onPropertyChanged (AbstractPropertyType propertyType, KzuPropertyNotificationReason reason) |
Virtual function to handle property change notifications. More... | |
AppliedStyleEntry * | applyObjectStyle (kanzi::StyleSharedPtr style) |
Applies a style to an object. More... | |
void | unapplyObjectStyle (AppliedStyleEntry *appliedStyleEntry) |
void | applyObjectStyles () |
Apply all styles for an object node. More... | |
void | unapplyObjectStyles () |
Unapplies and removes all applied styles. More... | |
Static Public Member Functions | |
static PropertyTypeEditorInfoSharedPtr | makeEditorInfo () |
static shared_ptr < FromToAnimation > | create (Domain *domain, chrono::milliseconds duration, optional< TValueType > from, optional< TValueType > to) |
![]() | |
static const Metaclass * | getStaticMetaclass () |
Returns the metaclass of Object class. More... | |
static PropertyTypeEditorInfoSharedPtr | makeEditorInfo () |
Default implementation that returns empty editor info. More... | |
Protected Member Functions | |
FromToAnimation (Domain *domain, chrono::milliseconds duration, optional< TValueType > from, optional< TValueType > to) | |
Constructor. More... | |
virtual optional < chrono::milliseconds > | getDurationOverride () KZ_OVERRIDE |
Virtual function the derived classes should overload to return duration. More... | |
float | easeTime (float normalizedTime) const |
![]() | |
ValueAnimation (Domain *domain) | |
Constructor. More... | |
![]() | |
AbstractAnimation (Domain *domain) | |
Constructor. More... | |
![]() | |
void | initialize () |
void | onCopy (const Object &other) |
Additional Inherited Members | |
![]() | |
typedef vector < AppliedStyleEntry * > | AppliedStyleContainer |
Applied style container. More... | |
![]() | |
AppliedStyleContainer | m_appliedStyles |
Listing of applied styles applied to this object. More... | |
Template class for from-to animations.
TValueType | Defines the type of the value you want to animate. For example, float, bool, int, ColorRGBA. |
TEasingFunction | defines the type of the easing function used for the animation. For example, LinearEasingFunction, SmoothStepEasingFunction, BackEasingFunction. For a full list of easing functions see easing_curve.hpp |
The Kanzi animation system consists animations and timelines: animations define how to animate a property, and timelines map the animations to time and to objects you want to animate.
From-to animation defines from which to which value to change the value of a property. You can omit either of these values to animate either from the current value or to the current value of the property.
From-to animations use an easing curve that defines the rate of change for the animation. You can use one of the easing curves that comes with Kanzi, or define your own. With the easing mode you can control how the easing function is applied to the animation:
To create a from-to animation:
To animate a property value in a node using a from-to animation:
To animate a property field value in a node using a from-to animation:
To create a float from-to animation that uses the back easing curve and the ease out easing mode:
To play an animation regardless of the timeline type:
|
inlineexplicitprotected |
Constructor.
|
inlinestatic |
|
inlinestatic |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inlinevirtual |
Returns new animated value given current value and time.
Classes derived from ValueAnimation define data and algorithms to calculate the value returned by this function.
currentValue | Current value that is used as basis for animation calculations. |
Implements kanzi::ValueAnimation< TValueType >.
|
inlineprotectedvirtual |
Virtual function the derived classes should overload to return duration.
Default implementation returns nullopt to indicate infinite animation.
Reimplemented from kanzi::AbstractAnimation.
|
inlineprotected |