CompositionObject.StartAnimationGroup(ICompositionAnimationBase) 메서드
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
애니메이션 그룹을 시작합니다.
CompositionObject의 StartAnimationGroup 메서드를 사용하면 CompositionAnimationGroup을 시작할 수 있습니다. 그룹의 모든 애니메이션은 개체에서 동시에 시작됩니다.
public:
virtual void StartAnimationGroup(ICompositionAnimationBase ^ value) = StartAnimationGroup;
void StartAnimationGroup(ICompositionAnimationBase const& value);
public void StartAnimationGroup(ICompositionAnimationBase value);
function startAnimationGroup(value)
Public Sub StartAnimationGroup (value As ICompositionAnimationBase)
매개 변수
시작할 애니메이션 그룹입니다.
Windows 요구 사항
디바이스 패밀리 |
Windows 10 Anniversary Edition (10.0.14393.0에서 도입되었습니다.)
|
API contract |
Windows.Foundation.UniversalApiContract (v3.0에서 도입되었습니다.)
|
예제
class PropertyAnimation
{
PropertyAnimation(Compositor compositor, SpriteVisual heroVisual)
{
// Define ImplicitAnimations
ImplicitAnimationCollection implicitAnimations = compositor.CreateImplicitAnimationCollection();
// Animate multiple properties on the target when the “Offset” property changes.
CompositionAnimationGroup animationGroup = compositor.CreateCompositionAnimationGroup();
animationGroup.Add(CreateSizeAnimation(compositor));
animationGroup.Add(CreateRotationAnimation(compositor));
// Set the CenterPoint so that rotation will be around the center
heroVisual.CenterPoint = new Vector3((heroVisual.Size.X/2.0f), (heroVisual.Size.Y/2.0f), 0.0f);
// Start AnimationGroup
heroVisual.StartAnimationGroup(animationGroup);
}
Vector2KeyFrameAnimation CreateSizeAnimation(Compositor compositor)
{
Vector2KeyFrameAnimation animation = compositor.CreateVector2KeyFrameAnimation();
CubicBezierEasingFunction easing = compositor.CreateCubicBezierEasingFunction(new Vector2(0.80f, 0.0f), new Vector2(0.95f, 1.0f));
// value (as the animation will target on the “Size” property).
animation.InsertExpressionKeyFrame(0f, "this.StartingValue", easing);
animation.InsertExpressionKeyFrame(1f, "this.StartingValue * 2", easing);
animation.Duration = TimeSpan.FromSeconds(0.25);
animation.Target = “Size”;
return animation;
}
ScalarKeyFrameAnimation CreateRotationAnimation(Compositor compositor)
{
ScalarKeyFrameAnimation animation = compositor.CreateScalarKeyFrameAnimation();
// Create KeyFrameAnimation to animate RotationAngleInDegrees by 90 degrees.
animation.InsertExpressionKeyFrame(0f, "this.StartingValue”);
animation.InsertExpressionKeyFrame(1f, "this.StartingValue + 90.0f”);
animation.Duration = TimeSpan.FromSeconds(0.25);
animation.Target = “RotationAngleInDegrees”;
return animation;
}
}
설명
StartAnimationGroup은 CompositionAnimationGroup 을 매개 변수로 사용하여 개체에서 그룹의 모든 애니메이션을 동시에 시작합니다. 그룹의 CompositionAnimation에는 Target 속성에 할당된 값이 있어야 합니다.
모든 애니메이션에 대해 Completed 이벤트를 얻으려면 등록된 Completed 이벤트가 있는 CompositionScopedBatch에서 StartAnimationGroup을 호출해야 합니다.
적용 대상
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기