Vector3KeyFrameAnimation
Vector3KeyFrameAnimation
Vector3KeyFrameAnimation
Vector3KeyFrameAnimation
Class
Definition
A time-based animation that targets any Vector3-based property with one or more keyframes.
public : sealed class Vector3KeyFrameAnimation : KeyFrameAnimation, IVector3KeyFrameAnimationpublic sealed class Vector3KeyFrameAnimation : KeyFrameAnimation, IVector3KeyFrameAnimationPublic NotInheritable Class Vector3KeyFrameAnimation Inherits KeyFrameAnimation Implements IVector3KeyFrameAnimation// This API is not available in Javascript.
- Inheritance
-
Vector3KeyFrameAnimationVector3KeyFrameAnimationVector3KeyFrameAnimationVector3KeyFrameAnimation
- Attributes
| Device family |
Windows 10 (introduced v10.0.10240.0)
|
| API contract |
Windows.Foundation.UniversalApiContract (introduced v1)
|
Inherited Members
Inherited methods
Inherited properties
Examples
void AnimatingVisualOffset(Visual targetVisual)
{
var animation = _compositor.CreateVector3KeyFrameAnimation();
//
// Define specific easing functions.
//
var linear = _compositor.CreateLinearEasingFunction();
var easeIn = _compositor.CreateCubicBezierEasingFunction(
new Vector2(0.5f, 0.0f), new Vector2(1.0f, 1.0f));
var easeOut = _compositor.CreateCubicBezierEasingFunction(
new Vector2(0.0f, 0.0f), new Vector2(0.5f, 1.0f));
//
// Add a set of key frames to describe how the Offset should change over time.
//
animation.InsertKeyFrame(0.00f, new Vector3(100.0f, 100.0f, 0.0f));
animation.InsertKeyFrame(0.25f, new Vector3(300.0f, 100.0f, 0.0f), easeIn);
animation.InsertKeyFrame(0.50f, new Vector3(300.0f, 300.0f, 0.0f), linear);
animation.InsertKeyFrame(0.75f, new Vector3(100.0f, 300.0f, 0.0f), linear);
animation.InsertKeyFrame(1.00f, new Vector3(100.0f, 100.0f, 0.0f), easeOut);
//
// The animation curve defined by the key frames will scale to match the duration.
//
animation.Duration = TimeSpan.FromMilliseconds(4000);
targetVisual.StartAnimation("Offset", animation);
}
Remarks
Use the CompostionObject.StartAnimation and CompostionObject.StopAnimation methods to start and stop the animation.
An animation is associated with an object's property by calling CompositionObject::StartAnimation and specifying the property name and the animation. See the remarks section of CompositionObject::StartAnimation for a list of animatable properties.
Methods
InsertKeyFrame(Single, Vector3) InsertKeyFrame(Single, Vector3) InsertKeyFrame(Single, Vector3) InsertKeyFrame(Single, Vector3)
Inserts a key frame.
public : void InsertKeyFrame(float normalizedProgressKey, Vector3 value)public void InsertKeyFrame(Single normalizedProgressKey, Vector3 value)Public Function InsertKeyFrame(normalizedProgressKey As Single, value As Vector3) As void// This API is not available in Javascript.
- normalizedProgressKey
- float Single Single Single
The time the key frame should occur at, expressed as a percentage of the animation Duration. Allowed value is from 0.0 to 1.0.
- value
- Vector3 Vector3 Vector3 Vector3
The value of the key frame.
- See Also
InsertKeyFrame(Single, Vector3, CompositionEasingFunction) InsertKeyFrame(Single, Vector3, CompositionEasingFunction) InsertKeyFrame(Single, Vector3, CompositionEasingFunction) InsertKeyFrame(Single, Vector3, CompositionEasingFunction)
Inserts a key frame with the specified easing function.
public : void InsertKeyFrame(float normalizedProgressKey, Vector3 value, CompositionEasingFunction easingFunction)public void InsertKeyFrame(Single normalizedProgressKey, Vector3 value, CompositionEasingFunction easingFunction)Public Function InsertKeyFrame(normalizedProgressKey As Single, value As Vector3, easingFunction As CompositionEasingFunction) As void// This API is not available in Javascript.
- normalizedProgressKey
- float Single Single Single
The time the key frame should occur at, expressed as a percentage of the animation Duration. Allowed value is from 0.0 to 1.0.
- value
- Vector3 Vector3 Vector3 Vector3
The value of the key frame.
- easingFunction
- CompositionEasingFunction CompositionEasingFunction CompositionEasingFunction CompositionEasingFunction
The easing function to use when interpolating between frames.
- See Also