@@ -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
@@ -12455,17 +12455,21 @@ var Tile = new Class({
1245512455 * @since 3.0.0
1245612456 */
1245712457 this.physics = {};
12458- /**
12458+ /**
1245912459 * An empty object where physics-engine specific information (e.g. bodies) may be stored.
1246012460 *
1246112461 * @name Phaser.Tilemaps.Tile#orientation
1246212462 * @type {string}
1246312463 * @since 3.2.PR_svipal
1246412464 */
1246512465 // we default to orthogonal
12466- this.orientation = (orientation !== undefined) ? orientation : "orthogonal";
12467-
12468- // console.log("tile orientation : "+this.orientation)
12466+ // we need to deep copy the string to prevent the orientation later going out of scope
12467+ if (orientation == undefined) {
12468+ this.orientation = "orthogonal";
12469+ } else {
12470+ this.orientation = orientation // (' ' + orientation).slice(1)
12471+ }
12472+ console.log("tile orientation : "+this.orientation)
1246912473 },
1247012474
1247112475 /**
@@ -12898,25 +12902,23 @@ var Tile = new Class({
1289812902 */
1289912903 updatePixelXY: function ()
1290012904 {
12901- // Tiled places tiles on a grid of baseWidth x baseHeight. The origin for a tile is the
12902- // bottom left, while the Phaser renderer assumes the origin is the top left. The y
12903- // coordinate needs to be adjusted by the difference.
12904- console.log("width" + this.baseWidth)
12905- console.log("height" + this.baseHeight)
12906- if (this.orientation === "orthogonal") {
12905+ if (orientation === "orthogonal") {
12906+ // In orthogonal mode, Tiled places tiles on a grid of baseWidth x baseHeight. The origin for a tile is the
12907+ // bottom left, while the Phaser renderer assumes the origin is the top left. The y
12908+ // coordinate needs to be adjusted by the difference.
1290712909 this.pixelX = this.x * this.baseWidth;
1290812910 this.pixelY = this.y * this.baseHeight;
1290912911 console.log("orthopix "+this.pixelX+","+this.pixelY)
12910- } else if (this. orientation === "isometric") {
12912+ } else if (orientation === "isometric" ) {
1291112913 mapSize = 10
1291212914 // once we get the 'top' of the losange we need to remove half of the tile width.
1291312915 this.pixelX = (this.baseWidth/2)*mapSize + (this.x - this.y) * this.baseWidth *0.5;
1291412916 this.pixelY = (this.x + this.y) * this.baseHeight *0.5;
1291512917 console.log("isopix "+this.pixelX+","+this.pixelY)
12916- console.log(this )
12918+ console.log(self )
1291712919 } else {
12918- console.log(this )
12919- console.log("tile orientation : "+this. orientation)
12920+ console.log("self :" + self )
12921+ console.log("tile orientation 2 : "+orientation)
1292012922 }
1292112923
1292212924 // this.pixelY = this.y * this.baseHeight - (this.height - this.baseHeight);
@@ -102924,6 +102926,8 @@ var ParseTileLayers = function (json, insertNull)
102924102926 // index, x, y, width, height
102925102927 if (gidInfo.gid > 0)
102926102928 {
102929+ console.log("Tile ptl 1", newOffsetX, newOffsetY, json.tilewidth,
102930+ json.tileheight,json.orientation)
102927102931 tile = new Tile(layerData, gidInfo.gid, newOffsetX, newOffsetY, json.tilewidth,
102928102932 json.tileheight,json.orientation);
102929102933
@@ -102936,6 +102940,8 @@ var ParseTileLayers = function (json, insertNull)
102936102940 }
102937102941 else
102938102942 {
102943+ console.log("Tile ptl 2", newOffsetX, newOffsetY, json.tilewidth,
102944+ json.tileheight,json.orientation)
102939102945 blankTile = insertNull
102940102946 ? null
102941102947 : new Tile(layerData, -1, newOffsetX, newOffsetY, json.tilewidth, json.tileheight,json.orientation);
@@ -102978,6 +102984,8 @@ var ParseTileLayers = function (json, insertNull)
102978102984 // index, x, y, width, height
102979102985 if (gidInfo.gid > 0)
102980102986 {
102987+ console.log("Tile ptl 3", newOffsetX, newOffsetY, json.tilewidth,
102988+ json.tileheight,json.orientation)
102981102989 tile = new Tile(layerData, gidInfo.gid, x, output.length, json.tilewidth,
102982102990 json.tileheight, json.orientation);
102983102991
@@ -102990,6 +102998,8 @@ var ParseTileLayers = function (json, insertNull)
102990102998 }
102991102999 else
102992103000 {
103001+ console.log("Tile ptl 4", newOffsetX, newOffsetY, json.tilewidth,
103002+ json.tileheight,json.orientation)
102993103003 blankTile = insertNull
102994103004 ? null
102995103005 : new Tile(layerData, -1, x, output.length, json.tilewidth, json.tileheight, json.orientation);
@@ -104621,7 +104631,7 @@ var Tilemap = new Class({
104621104631
104622104632 for (var tileX = 0; tileX < width; tileX++)
104623104633 {
104624- console.log("Tile tm", tileX, tileY, tileWidth, tileHeight, this.tileWidth , this.tileHeight , this.orientation )
104634+ console.log("Tile tm", tileX, tileY, tileWidth, tileHeight, this.orientation , this.tileWidth , this.tileHeight )
104625104635 row.push(new Tile(layerData, -1, tileX, tileY, tileWidth, tileHeight, this.orientation, this.tileWidth, this.tileHeight));
104626104636 }
104627104637
@@ -177177,7 +177187,6 @@ module.exports = {
177177177187 */
177178177188var StaticTilemapLayerWebGLRenderer = function (renderer, src, interpolationPercentage, camera)
177179177189{
177180- console.log("webgl renderer")
177181177190 var tilesets = src.tileset;
177182177191
177183177192 var pipeline = src.pipeline;
@@ -177249,7 +177258,6 @@ module.exports = StaticTilemapLayerWebGLRenderer;
177249177258var StaticTilemapLayerCanvasRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix)
177250177259{
177251177260 src.cull(camera);
177252- console.log("canvas renderer")
177253177261 var renderTiles = src.culledTiles;
177254177262 var tileCount = renderTiles.length;
177255177263
0 commit comments