added step easing (#678)

* added snap easing
* moved step function to the bottom of the list

Co-authored-by: Robert <mail@rbeekman.nl>
This commit is contained in:
nikoandRobert authored and GitHub committed 2022-01-03 12:42:51 +01:00
1 parent ddcb2cfcdb
commit 8b1ce4e0ec
1 file changed
+10 -1
+10 -1
View File
@@ -54,6 +54,7 @@ namespace Artemis.Core
case Functions.BounceEaseIn: return BounceEaseIn(p); case Functions.BounceEaseIn: return BounceEaseIn(p);
case Functions.BounceEaseOut: return BounceEaseOut(p); case Functions.BounceEaseOut: return BounceEaseOut(p);
case Functions.BounceEaseInOut: return BounceEaseInOut(p); case Functions.BounceEaseInOut: return BounceEaseInOut(p);
case Functions.Step: return Step (p);
} }
} }
@@ -358,6 +359,13 @@ namespace Artemis.Core
return 0.5 * BounceEaseOut(p * 2 - 1) + 0.5; return 0.5 * BounceEaseOut(p * 2 - 1) + 0.5;
} }
/// <summary>
/// An snappy animation that moves instantly to the next destination on the next keyframe
/// </summary>
public static double Step (double p) {
return Math.Floor (p);
}
/// <summary> /// <summary>
/// Easing Functions enumeration /// Easing Functions enumeration
/// </summary> /// </summary>
@@ -393,7 +401,8 @@ namespace Artemis.Core
BackEaseInOut, BackEaseInOut,
BounceEaseIn, BounceEaseIn,
BounceEaseOut, BounceEaseOut,
BounceEaseInOut BounceEaseInOut,
Step
} }
} }
} }