@@ -12182,9 +12182,9 @@ module.exports = SetTileCollision;
1218212182 * @license {@link https://opensource.org/licenses/MIT|MIT License}
1218312183 */
1218412184
12185- var Class = __webpack_require__(0);
12186- var Components = __webpack_require__(11);
12187- var Rectangle = __webpack_require__(441);
12185+ var Class = __webpack_require__(0);
12186+ var Components = __webpack_require__(11);
12187+ var Rectangle = __webpack_require__(441);
1218812188
1218912189/**
1219012190 * @classdesc
@@ -12456,7 +12456,7 @@ var Tile = new Class({
1245612456 */
1245712457 this.physics = {};
1245812458 /**
12459- * An empty object where physics-engine specific information (e.g. bodies) may be stored .
12459+ * The tile's orientation, necessary to be able to determine pixelX and pixelY .
1246012460 *
1246112461 * @name Phaser.Tilemaps.Tile#orientation
1246212462 * @type {string}
@@ -12467,7 +12467,7 @@ var Tile = new Class({
1246712467 if (orientation == undefined) {
1246812468 this.orientation = "orthogonal";
1246912469 } else {
12470- this.orientation = orientation // (' ' + orientation).slice(1)
12470+ this.orientation = (' ' + orientation).slice(1)
1247112471 }
1247212472 console.log("tile orientation : "+this.orientation)
1247312473 },
@@ -12902,23 +12902,23 @@ var Tile = new Class({
1290212902 */
1290312903 updatePixelXY: function ()
1290412904 {
12905- if (orientation === "orthogonal") {
12905+ console.log("tile orientation 2: "+this.orientation)
12906+ if (this.orientation === "orthogonal") {
1290612907 // In orthogonal mode, Tiled places tiles on a grid of baseWidth x baseHeight. The origin for a tile is the
1290712908 // bottom left, while the Phaser renderer assumes the origin is the top left. The y
1290812909 // coordinate needs to be adjusted by the difference.
1290912910 this.pixelX = this.x * this.baseWidth;
1291012911 this.pixelY = this.y * this.baseHeight;
1291112912 console.log("orthopix "+this.pixelX+","+this.pixelY)
12912- } else if (orientation === "isometric" ) {
12913- mapSize = 10
12914- // once we get the 'top' of the losange we need to remove half of the tile width.
12915- this.pixelX = (this.baseWidth/2)*mapSize + (this.x - this.y) * this.baseWidth *0.5;
12913+ } else if (this.orientation === "isometric" ||true) {
12914+ // for the image to be centered we have to move the image to the right.
12915+ this.pixelX = this.layer.widthInPixels/2 + (this.x - this.y) * this.baseWidth *0.5;
1291612916 this.pixelY = (this.x + this.y) * this.baseHeight *0.5;
1291712917 console.log("isopix "+this.pixelX+","+this.pixelY)
12918- console.log(self )
12918+ // console.log(this )
1291912919 } else {
12920- console.log("self :" + self )
12921- console.log("tile orientation 2 : "+orientation)
12920+ console.log("this :" + this )
12921+ console.log("tile orientation 3 : "+this. orientation)
1292212922 }
1292312923
1292412924 // this.pixelY = this.y * this.baseHeight - (this.height - this.baseHeight);
0 commit comments