From d6489d1146f53d853d61dc8322beddd8aaee1506 Mon Sep 17 00:00:00 2001 From: Svipal Date: Wed, 29 Jan 2020 19:21:27 +0100 Subject: [PATCH] preparing WIP PR 2 --- src/tilemaps/Tile.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/tilemaps/Tile.js b/src/tilemaps/Tile.js index 500b25bab..29cc139c6 100644 --- a/src/tilemaps/Tile.js +++ b/src/tilemaps/Tile.js @@ -733,8 +733,9 @@ var Tile = new Class({ this.pixelY = this.y * this.baseHeight; console.log("orthopix "+this.pixelX+","+this.pixelY) } else if (this.orientation === "isometric" ||true) { - // for the image to be centered we have to move the image to the right. - this.pixelX = this.layer.widthInPixels/2 + (this.x - this.y) * this.baseWidth *0.5; + // for the image to be centered we have to move the image to the right with the camera ! + // this is crucial for wordtotile, tiletoworld to work. + this.pixelX = (this.x - this.y) * this.baseWidth *0.5; this.pixelY = (this.x + this.y) * this.baseHeight *0.5; console.log("isopix "+this.pixelX+","+this.pixelY) // console.log(this)