Fixed inaccurate unprojection if world boundaries do not start at 0, 0 (spotted by oboforty on the forums).

This commit is contained in:
lewster32
2015-05-21 20:54:54 +01:00
parent 98a6d01799
commit 4dfacf4e0d
5 changed files with 9 additions and 9 deletions
+2 -2
View File
@@ -1842,8 +1842,8 @@ Phaser.Plugin.Isometric.Projector.prototype = {
z = z || 0;
var x = point.x - (this.game.world.width * this.anchor.x);
var y = point.y - (this.game.world.height * this.anchor.y) + z;
var x = point.x - this.game.world.x - (this.game.world.width * this.anchor.x);
var y = point.y - this.game.world.y - (this.game.world.height * this.anchor.y) + z;
out.x = x / (2 * this._transform[0]) + y / (2 * this._transform[1]);
out.y = -(x / (2 * this._transform[0])) + y / (2 * this._transform[1]);
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "phaser-plugin-isometric",
"version": "0.9.1",
"version": "0.9.2",
"devDependencies": {
"grunt": "~0.4.5",
"grunt-contrib-clean": "^0.5.0",
+1 -1
View File
@@ -53,7 +53,7 @@ Phaser.Plugin.Isometric = function (game, parent) {
Phaser.Plugin.Isometric.prototype = Object.create(Phaser.Plugin.prototype);
Phaser.Plugin.Isometric.prototype.constructor = Phaser.Plugin.Isometric;
Phaser.Plugin.Isometric.VERSION = '0.9.1';
Phaser.Plugin.Isometric.VERSION = '0.9.2';
// Directional consts
Phaser.Plugin.Isometric.UP = 0;
+2 -2
View File
@@ -108,8 +108,8 @@ Phaser.Plugin.Isometric.Projector.prototype = {
z = z || 0;
var x = point.x - (this.game.world.width * this.anchor.x);
var y = point.y - (this.game.world.height * this.anchor.y) + z;
var x = point.x - this.game.world.x - (this.game.world.width * this.anchor.x);
var y = point.y - this.game.world.y - (this.game.world.height * this.anchor.y) + z;
out.x = x / (2 * this._transform[0]) + y / (2 * this._transform[1]);
out.y = -(x / (2 * this._transform[0])) + y / (2 * this._transform[1]);