Rendering a Spine object when a Camer has renderToTexture enabled on it would cause the object to be vertically flipped. It now renders correctly in both cases. Fix #4647

This commit is contained in:
Richard Davey 2019-07-17 15:10:18 +01:00
parent d5d9d990d8
commit 96511901c4
2 changed files with 11 additions and 7 deletions

View file

@ -86,8 +86,6 @@ var SpineGameObject = new Class({
var skeleton = data.skeleton;
skeleton.flipY = (this.scene.sys.game.config.renderType === 1);
skeleton.setToSetupPose();
skeleton.updateWorldTransform();
@ -276,9 +274,6 @@ var SpineGameObject = new Class({
{
var skeleton = this.skeleton;
skeleton.flipX = this.flipX;
skeleton.flipY = this.flipY;
this.state.update((delta / 1000) * this.timeScale);
this.state.apply(skeleton);

View file

@ -77,9 +77,18 @@ var SpineGameObjectWebGLRenderer = function (renderer, src, interpolationPercent
var height = renderer.height;
skeleton.x = calcMatrix.tx;
skeleton.y = height - calcMatrix.ty;
skeleton.scaleX = calcMatrix.scaleX;
skeleton.scaleY = calcMatrix.scaleY;
if (camera.renderToTexture)
{
skeleton.y = calcMatrix.ty;
skeleton.scaleY = calcMatrix.scaleY * -1;
}
else
{
skeleton.y = height - calcMatrix.ty;
skeleton.scaleY = calcMatrix.scaleY;
}
src.root.rotation = RadToDeg(CounterClockwise(calcMatrix.rotation));