AnimationController Structure |
Namespace: DigitalRune.Animation
The AnimationController type exposes the following members.
Name | Description | |
---|---|---|
AutoRecycle |
Automatically recycles the animation instances when the animation is stopped and removed
from the animation system.
| |
Equals | Indicates whether this instance and a specified object are equal. (Inherited from ValueType.) | |
GetHashCode | Returns the hash code for this instance. (Inherited from ValueType.) | |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
Pause |
Stops the animation from progressing.
| |
Recycle |
Recycles the animation instances associated with this controller.
| |
Resume |
Resumes an animation that was previously paused.
| |
Start |
Starts the animation immediately.
| |
Start(AnimationTransition) |
Starts the animation using the specified transition.
| |
Stop |
Stops the animation immediately.
| |
Stop(TimeSpan) |
Stops the animation by fading it out over time.
| |
ToString | Returns the fully qualified type name of this instance. (Inherited from ValueType.) | |
UpdateAndApply |
Immediately evaluates the animation and applies the new animation values.
|
Name | Description | |
---|---|---|
AnimationInstance |
Gets the root animation instance.
| |
AnimationService |
Gets the animation service.
| |
AutoRecycleEnabled |
Gets or sets a value indicating whether the animation instance should be automatically
recycled when the animation is stopped and removed from the animation system.
| |
IsPaused |
Gets a value indicating whether the animation is paused.
| |
IsValid |
Gets a value indicating whether this animation controller is valid.
| |
Speed |
Gets or sets the rate at which time progresses.
| |
State |
Gets the current state of the animation.
| |
Time |
Gets or sets the current animation time.
| |
Weight |
Gets or sets the animation weight.
|
Name | Description | |
---|---|---|
Completed |
Occurs when the animation has completed playing. Use with caution - see remarks.
|
Animation controllers provide interactive control over animations. They are created when a new animation is started using one of the StartAnimation-methods of the IAnimationService. Animation controllers can also be created explicitly by calling one of the CreateController-methods. Using the animation controller the user can:
Animation State and Timing: The property State returns the current state of the animation. The animation can be Delayed, Playing, Filling or Stopped. But the state does not indicate whether the animation timing is active. The property IsPaused indicates whether the animation timing is active or paused.
Memory Management: The following information is relevant for users who want to reduce garbage collector (GC) overhead, in particular on the Xbox 360.
The type AnimationController is a value type (struct). It is a lightweight handle that stores a reference to the IAnimationService and the AnimationInstance.
Objects of type AnimationInstance are automatically created when a new animation controller is created. The animation instances maintain the runtime-state of the animations. Animation instances can be recycled when they are no longer used. They can then be reused by the animation system for future animations.
It is recommended to recycle animation instances in order to reduce the number of memory allocations at runtime. Animation instances can be recycled explicitly by calling Recycle. Or, they can be recycled automatically by calling AutoRecycle or setting the property AutoRecycleEnabled to . If AutoRecycleEnabled is set, then the animation system will automatically recycle the animation instances once the animation has stopped. The property AutoRecycleEnabled is by default.
The method Recycle can be called at any time, regardless of whether AutoRecycleEnabled is set. The property AutoRecycleEnabled can also be changed at any time - it will only take effect when the animation stops.
Once the animation instance has been recycled the struct AnimationController becomes invalid. The property IsValid indicates whether the animation instance is still alive or has already been recycled.