[libgdx] updateWorldTransform as late as possible.

Something can set a new animation after `act` but before `draw`, resuling in the wrong pose if updateWorldTransform is done in `act`.
This commit is contained in:
NathanSweet 2018-04-17 14:12:24 +02:00
parent bceee601ad
commit 66eabfc4d1

View File

@ -58,7 +58,6 @@ public class SkeletonActor extends Actor {
public void act (float delta) {
state.update(delta);
state.apply(skeleton);
skeleton.updateWorldTransform();
super.act(delta);
}
@ -71,6 +70,7 @@ public class SkeletonActor extends Actor {
skeleton.getColor().a *= parentAlpha;
skeleton.setPosition(getX(), getY());
skeleton.updateWorldTransform();
renderer.draw(batch, skeleton);
if (resetBlendFunction) batch.setBlendFunctionSeparate(blendSrc, blendDst, blendSrcAlpha, blendDstAlpha);