1
0
Fork 0
mirror of https://github.com/Ellpeck/MLEM.git synced 2024-11-22 12:58:33 +01:00

Added missing easing functions Quart and Quint to Easings

This commit is contained in:
Ell 2021-11-16 15:08:35 +01:00
parent 91d34c0a83
commit a59f1eb8af
2 changed files with 15 additions and 0 deletions

View file

@ -12,6 +12,7 @@ Additions
- Added a strikethrough formatting code
- Added GenericFont SplitStringSeparate which differentiates between existing newline characters and splits due to maximum width
- Added StaticSpriteBatch class
- Added missing easing functions Quart and Quint to Easings
Improvements
- Cache TokenizedString inner offsets for non-Left text alignments to improve performance

View file

@ -29,6 +29,20 @@ namespace MLEM.Misc {
/// <summary>https://easings.net/#easeInOutCubic</summary>
public static readonly Easing InOutCubic = p => p < 0.5F ? 4 * p * p * p : 1 - (-2 * p + 2) * (-2 * p + 2) * (-2 * p + 2) / 2;
/// <summary>https://easings.net/#easeInQuart</summary>
public static readonly Easing InQuart = p => p * p * p * p;
/// <summary>https://easings.net/#easeOutQuart</summary>
public static readonly Easing OutQuart = p => 1 - (1 - p) * (1 - p) * (1 - p) * (1 - p);
/// <summary>https://easings.net/#easeInOutQuart</summary>
public static readonly Easing InOutQuart = p => p < 0.5F ? 8 * p * p * p * p : 1 - (-2 * p + 2) * (-2 * p + 2) * (-2 * p + 2) * (-2 * p + 2) / 2;
/// <summary>https://easings.net/#easeInQuint</summary>
public static readonly Easing InQuint = p => p * p * p * p * p;
/// <summary>https://easings.net/#easeOutQuint</summary>
public static readonly Easing OutQuint = p => 1 - (1 - p) * (1 - p) * (1 - p) * (1 - p) * (1 - p);
/// <summary>https://easings.net/#easeInOutQuint</summary>
public static readonly Easing InOutQuint = p => p < 0.5F ? 16 * p * p * p * p * p : 1 - (-2 * p + 2) * (-2 * p + 2) * (-2 * p + 2) * (-2 * p + 2) * (-2 * p + 2) / 2;
/// <summary>https://easings.net/#easeInExpo</summary>
public static readonly Easing InExpo = p => p == 0 ? 0 : (float) Math.Pow(2, 10 * p - 10);
/// <summary>https://easings.net/#easeOutExpo</summary>