This project is read-only.

Custom Ease Functions

Overview

Custom Ease functions can be added at any time. They are only in place to manipulate the ellapsed time percentage which is 0 (start) -> 1 (complete).

Syntax

The PercentHandler expects a double value from 0 -> 1 and will return a double value to manipulate the time used before it reaches your Getter/Setter. This example just returns the time supplied so no easing will be applied.

    double LinearEase (double ellapsedTime)
    {
        return ellapsedTime;
    }
    
    ball.RotateTo(360, time, LinearEase, delay);

Usage

    // returns .25, .5, .75, or 1
    
    double QuarterEase (double ellapsedTime)
    {
        return Math.Round(ellapsedTime / .25) * .25;
    }
    
    ArtefactAnimator.AddEase(element, "x", 250, time, QuarterEase, delay);

Usage | BounceEase

    public static System.Windows.Media.Animation.BounceEase myBounce = new System.Windows.Media.Animation.BounceEase()
    { 
        Bounces = 3, Bounciness = 2 
    }

    public static PercentHandler myBounceEase = (percent) => 
    { 
        return myBounce.Ease(percent); 
    }

    ball.SlideTo(x, y, time, myBounceEase, delay);

Pre-Defined Ease Functions

  • AnimationTransitions.BackEaseIn
  • AnimationTransitions.BackEaseOut
  • AnimationTransitions.BackEaseOutIn
  • AnimationTransitions.BackEaseInOut
  • AnimationTransitions.BounceEaseIn
  • AnimationTransitions.BounceEaseOut
  • AnimationTransitions.BounceEaseOutIn
  • AnimationTransitions.BounceEaseInOut
  • AnimationTransitions.CircEaseIn
  • AnimationTransitions.CircEaseOut
  • AnimationTransitions.CircEaseOutIn
  • AnimationTransitions.CircEaseInOut
  • AnimationTransitions.ElasticEaseIn
  • AnimationTransitions.ElasticEaseOut
  • AnimationTransitions.ElasticEaseOutIn
  • AnimationTransitions.ElasticEaseInOut
  • AnimationTransitions.ExpoEaseIn
  • AnimationTransitions.ExpoEaseOut
  • AnimationTransitions.ExpoEaseOutIn
  • AnimationTransitions.ExpoEaseInOut
  • AnimationTransitions.QuadEaseIn
  • AnimationTransitions.QuadEaseOut
  • AnimationTransitions.QuadEaseOutIn
  • AnimationTransitions.QuadEaseInOut
  • AnimationTransitions.QuartEaseIn
  • AnimationTransitions.QuartEaseOut
  • AnimationTransitions.QuartEaseOutIn
  • AnimationTransitions.QuartEaseInOut
  • AnimationTransitions.QuintEaseIn
  • AnimationTransitions.QuintEaseOut
  • AnimationTransitions.QuintEaseOutIn
  • AnimationTransitions.QuintEaseInOut
  • AnimationTransitions.SineEaseIn
  • AnimationTransitions.SineEaseOut
  • AnimationTransitions.SineEaseOutIn
  • AnimationTransitions.SineEaseInOut

Last edited Sep 27, 2011 at 10:11 AM by jgraup, version 2

Comments

Kistjes Oct 7, 2011 at 8:30 AM 
Seems the SineEaseInOut works the same as SineEaseOutIn.

Compare:

public static System.Windows.Media.Animation.SineEase mySine = new System.Windows.Media.Animation.SineEase()
{
EasingMode = System.Windows.Media.Animation.EasingMode.EaseInOut
};

public static PercentHandler mySineEase = (percent) =>
{
return mySine.Ease(percent);
};

with:

AnimationTransitions.SineEaseInOut;

and you'll see what I mean.