Funkin/source/funkin/util/EaseUtil.hx

18 lines
382 B
Haxe
Raw Normal View History

2024-04-04 05:22:44 -04:00
package funkin.util;
class EaseUtil
{
/**
* Returns an ease function that eases via steps.
* Useful for "retro" style fades (week 6!)
* @param steps how many steps to ease over
* @return Float->Float
*/
public static inline function stepped(steps:Int):Float->Float
{
return function(t:Float):Float {
return Math.floor(t * steps) / steps;
}
}
}