frameOffset for atlases (need testing)

This commit is contained in:
Yoshman29
2026-01-19 00:48:59 +01:00
parent 546db6eaa4
commit c2bdb1b75c
2 changed files with 37 additions and 1 deletions
+24
View File
@@ -376,6 +376,30 @@ class FunkinSprite extends FlxAnimate implements IBeatReceiver implements IOffse
return val;
}
override function draw():Void {
if (isAnimate) {
var posOffset:FlxPoint = FlxPoint.get(-frameOffset.x * scale.x, -frameOffset.y * scale.y);
var angleOff = angle;
if (frameOffsetAngle != null)
angleOff = frameOffsetAngle;
angleOff *= FlxAngle.TO_RAD;
posOffset.rotateWithTrig(Math.sin(angleOff), Math.cos(angleOff));
x += posOffset.x;
y += posOffset.y;
super.draw();
x -= posOffset.x;
y -= posOffset.y;
posOffset.put();
} else
super.draw();
}
override function drawComplex(camera:FlxCamera):Void
{
#if (flixel < "6.1.0") final frame = this._frame; #end
@@ -264,7 +264,19 @@ class CharacterAnimButton extends UIButton {
var oldAnim:String = animData.anim;
animData.anim = newAnim;
__refreshAnimation();
var flxAnimation:FlxAnimation = __getFlxAnimation();
flxAnimation.prefix = newAnim;
refreshFlxAnimationFrames(flxAnimation, animData);
if (valid) {
parent.buildAnimDisplay(anim, data);
animationDisplayBG.alpha = 1;
} else {
parent.removeAnimDisplay(anim);
animationDisplayBG.alpha = 0.4;
}
if (parent.character.getAnimName() == anim)
CharacterEditor.instance.playAnimation(anim);