1
0
Fork 0
mirror of https://github.com/ninjamuffin99/Funkin.git synced 2024-09-19 16:41:39 +00:00
Funkin/source/funkin/util/SortUtil.hx

20 lines
510 B
Haxe
Raw Normal View History

package funkin.util;
2022-01-26 19:19:57 +00:00
2022-02-23 21:49:54 +00:00
#if !macro
2022-01-26 19:19:57 +00:00
import flixel.group.FlxGroup.FlxTypedGroup;
import flixel.util.FlxSort;
import flixel.FlxObject;
2022-02-23 21:49:54 +00:00
#end
2022-01-26 19:19:57 +00:00
class SortUtil
{
/**
* You can use this function in FlxTypedGroup.sort() to sort FlxObjects by their z-index values.
* The value defaults to 0, but by assigning it you can easily rearrange objects as desired.
*/
public static inline function byZIndex(Order:Int, Obj1:FlxObject, Obj2:FlxObject):Int
{
return FlxSort.byValues(Order, Obj1.zIndex, Obj2.zIndex);
}
}