Files
FNF-i486-Engine/source/psychlua/ModchartAnimateSprite.hx
Vinegar (Moxie) d7a31ab061 feat: rewrite Lua and HScript to be more modular
* Rewrote Lua by separating most of its classes and such into its own things so other classes can make use of them
* Made HScript better by being able to open multiple instances, and should work better then the old one that was held together by sticks and glue
* Made HScript less reliant on Lua (still needs it to function currently)
* Removed Smokeyys Animate Atlas in favor of FlxAnimate (it used more ram, and could only load 2018 atlases)
* Bump version internally due to breaking changes introduced
* TODO: Add more extensive HScript support and both need thorough testing, and add backwards compatibility
2025-08-07 17:51:11 -04:00

26 lines
663 B
Haxe

package psychlua;
#if flxanimate
class ModchartAnimateSprite extends FlxAnimate
{
public var animOffsets:Map<String, Array<Float>> = new Map<String, Array<Float>>();
public function new(?x:Float = 0, ?y:Float = 0)
{
super(x, y);
antialiasing = ClientPrefs.globalAntialiasing;
}
public function playAnim(name:String, forced:Bool = false, ?reverse:Bool = false, ?startFrame:Int = 0)
{
anim.play(name, forced, reverse, startFrame);
var daOffset = animOffsets.get(name);
if (animOffsets.exists(name)) offset.set(daOffset[0], daOffset[1]);
}
public function addOffset(name:String, x:Float, y:Float)
{
animOffsets.set(name, [x, y]);
}
}
#end