Added blitter coordinates to bob output

This commit is contained in:
Richard Davey 2018-01-20 16:21:59 +00:00
parent d220634fb6
commit a5a112114b
2 changed files with 6 additions and 3 deletions

View file

@ -23,7 +23,10 @@ var BlitterCanvasRenderer = function (renderer, src, interpolationPercentage, ca
ca = renderer.setAlpha(bob.alpha);
}
renderer.blitImage(bob.x, bob.y, bob.frame, camera);
// var x = src.x + bob.x + frame.x - cameraScrollX + ((frame.width) * (bob.flipX ? 1 : 0));
// var y = src.y + bob.y + frame.y - cameraScrollY + ((frame.height) * (bob.flipY ? 1 : 0));
renderer.blitImage(src.x + bob.x, src.y + bob.y, bob.frame, camera);
}
};

View file

@ -33,8 +33,8 @@ var BlitterWebGLRenderer = function (renderer, src, interpolationPercentage, cam
var uvs = frame.uvs;
var width = frame.width * (bob.flipX ? -1 : 1);
var height = frame.height * (bob.flipY ? -1 : 1);
var x = bob.x + frame.x - cameraScrollX + ((frame.width) * (bob.flipX ? 1 : 0.0));
var y = bob.y + frame.y - cameraScrollY + ((frame.height) * (bob.flipY ? 1 : 0.0));
var x = src.x + bob.x + frame.x - cameraScrollX + ((frame.width) * (bob.flipX ? 1 : 0));
var y = src.y + bob.y + frame.y - cameraScrollY + ((frame.height) * (bob.flipY ? 1 : 0));
var xw = x + width;
var yh = y + height;
var tx = x * a + y * c + e;