Assembly: DigitalRune.Animation (in DigitalRune.Animation.dll) Version: 188.8.131.52 (184.108.40.20603)
An animation in the traditional sense is the rapid display of images to create the illusion of movement. Here, in DigitalRune Animation, the term animation is used in a more general way: An animation determines the change of value over time.
Animations can be applied to all kinds of properties in an application. In a user-interface properties such as size, position, rotation, color, opacity, etc. can be animated to create interesting visual effects. In virtual worlds more complex animations can be used to control the motions of objects or virtual characters.
An animation defines the transition of a value over time. It is basically a function x = f(t) where the parameter t is called the animation time and the result x is the animation value. The method GetValue(TimeSpan, T%, T%, T%) can be used to evaluate the animation value.
Target Object and Property: An animation can be applied to a property of a given object. The animation system allows to apply an animation to an object or a group of objects without explicitly specifying the property that should be animated. In this case the animation system automatically matches the target object and properties using the properties TargetObject and TargetProperty. TargetObject and TargetProperty are optional strings that can be set to identify the target.
For example, a TimelineGroup can be used to define a complex set of animations. Each animation is assigned to an object/property by setting TargetObject and TargetProperty. At runtime, when the TimelineGroup is started the animation system will automatically apply the animations to the matching objects.
The animation system first checks whether the property TargetObject is set and matches the name of any of the given objects. The animation system assumes that all objects have a unique name. Therefore, as soon as one match is found the animation system ignores all remaining objects/properties. If a match is found, it checks whether the object has a matching animatable property. If the property TargetObject is not set (the value is nullNothingnullptra null reference (Nothing in Visual Basic) or an empty string), the animation system checks all objects for a matching property.
The animation system checks whether an animatable property matches the property TargetProperty and whether the type of the property is compatible with the animation. An animation is applied to the first matching property. If there are multiple potential matches the animation is only applied to the first match.
Note that timelines can be nested. In this case the parent's TargetObject or TargetProperty property overrides the values set by child animations. For example, if the property TargetObject is set in a TimelineGroup the value overrides the TargetObject properties of all child animations/timelines.
Additive Animations: Animations can be additive, meaning that the animation value is added to the target property. If there are multiple animation in an composition chain, the animation value will be added to the output of the previous stage. If the animation is the first animation in a composition chain, the animation value is added to the base value of the property that is being animated.