FlxSpine doesn't handle scaling correctly
It seems that scaling is distorted when an image is rotated. This works correctly with renderMeshes = true, and incorrectly when renderMeshes = false. For example, here's a slime which does a "squishing" animation (where it gets smaller vertically, then goes back to normal.)
Normal slime:
With renderMeshes (this is also what it looks like in the Spine editor):
Without renderMeshes, he's getting smaller along the horizontal axis instead:
For this specific animation, swapping worldScaleX and worldScaleY:
wrapper.scale.x *= worldScaleY * flipX;
wrapper.scale.y *= worldScaleX * flipY;
...gives the right appearance, but doesn't seem like a general solution.
I'm looking into this, but leaving this here in case anyone else has seen the issue or has an idea.
It seems like the problem is that "x" and "y" in scale timelines represent bone-local axes so are being applied incorrectly. In my case the bone is oriented at about 90 degrees, so the scaling at runtime is 90 degrees off.
In case anyone else runs into this, I'm using the following workaround:
_matrix.rotate(wrapper.angle * Math.PI / 180);
_matrix.scale(wrapper.scale.x, wrapper.scale.y);
_matrix.translate(wrapper.origin.x, wrapper.origin.y);
_matrix.scale(bone.worldScaleX * flipX, bone.worldScaleY * flipY);
_matrix.rotate(flip * -bone.worldRotation * Math.PI / 180);
_matrix.translate(
skeleton.x + bone.worldX,
skeleton.y + bone.worldY
);
...then using a very hacky method with @:access to render the wrapper image with this transformation matrix instead of calling draw directly. This isn't quite perfect yet - it's off by 180 degrees if you negatively scale an image which was rotated in the atlas - but good enough for me right now.