Johnny Westlake
Johnny Westlake

Reputation: 1459

Find out Easing Functions for WinRT Theme Animations

A slightly odd question, but is there anyway to find out what easing functions are used in the WinRT XAML Theme Animations - more specifically I'm trying to replicate that of the EntranceThemeTransition (which I can't use directly).

I naively thought using something like .NET reflector would help, but I'd gather I'd need the actual source code rather than what .Net Reflector shows.

Anyone any ideas?

Upvotes: 1

Views: 544

Answers (2)

Craig Presti - MSFT
Craig Presti - MSFT

Reputation: 1145

You might like to take a look at the AnimationMetrics sample on MSDN.

There is an AnimationDescription class that will tell you all sorts of info on the built in animation types, basically anything in the Windows.UI.Core.AnimationMetrics.AnimationEffect enum.

For example:

var animationDescription = new AnimationDescription(AnimationEffect.EnterPage, AnimationEffectTarget.Incoming);

var s = new System.Text.StringBuilder();
s.AppendFormat("Stagger delay = {0}ms", animationDescription.StaggerDelay.TotalMilliseconds);
s.AppendLine();
s.AppendFormat("Stagger delay factor = {0}", animationDescription.StaggerDelayFactor);
s.AppendLine();
s.AppendFormat("Delay limit = {0}ms", animationDescription.DelayLimit.TotalMilliseconds);
s.AppendLine();
s.AppendFormat("ZOrder = {0}", animationDescription.ZOrder);
s.AppendLine();
s.AppendLine();
//etc

Link: http://code.msdn.microsoft.com/windowsapps/Animation-metrics-sample-acb0220c

Upvotes: 1

Filip Skakun
Filip Skakun

Reputation: 31724

I believe these built in animations are implemented in a different way and they run independently from regular Storyboard + child animations, so you would need to approximate these with some tests that compare these with regular Storyboard animations that you implement running side by side.

One way to visualize easing functions is to run a theme transition moving a UI element in one axis while you run another one that moves the element in a perpendicular axis in a linear motion (with no easing function applied).

Upvotes: 0

Related Questions