mirror of
https://github.com/photonstorm/phaser
synced 2024-11-16 17:58:23 +00:00
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:
parent
d5d9d990d8
commit
96511901c4
2 changed files with 11 additions and 7 deletions
|
@ -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);
|
||||
|
|
|
@ -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));
|
||||
|
||||
|
|
Loading…
Reference in a new issue