Files
FNF-i486-Engine/source/psychlua/ModchartSprite.hx
Altertoriel 6ca6e3f284 Lua Improvements (#468)
* Lua Improvments

* fix

* fix 2

* fix 3

* fix 4

* fix 5

* fix 6

* Fix 7, please action dont fail

* done

* done 2

* done 3

* final

* last fix

* please last fix final

* add `curSection` on lua

* ready for pr

* oops

* oop2

* Lua Improvements 2

* Update Project.xml

* fixed `lastCalledScript`

* Attempt Fix 2

* Attempt fix 3

* shit

* done i think

* fuck

* fuck 2
2024-08-01 01:53:54 -04:00

24 lines
640 B
Haxe

package psychlua;
class ModchartSprite extends FlxSprite
{
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)
{
animation.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]);
}
}