1
0
Fork 0
mirror of https://github.com/ninjamuffin99/Funkin.git synced 2025-08-31 10:56:21 +00:00
Funkin/source/funkin/util/EaseUtil.hx

19 lines
395 B
Haxe
Raw Permalink Normal View History

2024-04-04 09:22:44 +00:00
package funkin.util;
@:nullSafety
2024-04-04 09:22:44 +00:00
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;
}
}
}