frameOffset for atlases (need testing)
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user