Skip to content

Commit ccbff39

Browse files
committed
preparing WIP PR
1 parent a82b27c commit ccbff39

5 files changed

Lines changed: 32 additions & 33 deletions

File tree

dist/phaser-arcade-physics.js

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -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);

dist/phaser-arcade-physics.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/phaser.js

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14106,9 +14106,9 @@ module.exports = SetTileCollision;
1410614106
* @license {@link https://opensource.org/licenses/MIT|MIT License}
1410714107
*/
1410814108

14109-
var Class = __webpack_require__(0);
14110-
var Components = __webpack_require__(11);
14111-
var Rectangle = __webpack_require__(441);
14109+
var Class = __webpack_require__(0);
14110+
var Components = __webpack_require__(11);
14111+
var Rectangle = __webpack_require__(441);
1411214112

1411314113
/**
1411414114
* @classdesc
@@ -14380,7 +14380,7 @@ var Tile = new Class({
1438014380
*/
1438114381
this.physics = {};
1438214382
/**
14383-
* An empty object where physics-engine specific information (e.g. bodies) may be stored.
14383+
* The tile's orientation, necessary to be able to determine pixelX and pixelY.
1438414384
*
1438514385
* @name Phaser.Tilemaps.Tile#orientation
1438614386
* @type {string}
@@ -14391,7 +14391,7 @@ var Tile = new Class({
1439114391
if (orientation == undefined) {
1439214392
this.orientation = "orthogonal";
1439314393
} else {
14394-
this.orientation = orientation // (' ' + orientation).slice(1)
14394+
this.orientation = (' ' + orientation).slice(1)
1439514395
}
1439614396
console.log("tile orientation : "+this.orientation)
1439714397
},
@@ -14826,23 +14826,23 @@ var Tile = new Class({
1482614826
*/
1482714827
updatePixelXY: function ()
1482814828
{
14829-
if (orientation === "orthogonal") {
14829+
console.log("tile orientation 2: "+this.orientation)
14830+
if (this.orientation === "orthogonal") {
1483014831
// In orthogonal mode, Tiled places tiles on a grid of baseWidth x baseHeight. The origin for a tile is the
1483114832
// bottom left, while the Phaser renderer assumes the origin is the top left. The y
1483214833
// coordinate needs to be adjusted by the difference.
1483314834
this.pixelX = this.x * this.baseWidth;
1483414835
this.pixelY = this.y * this.baseHeight;
1483514836
console.log("orthopix "+this.pixelX+","+this.pixelY)
14836-
} else if (orientation === "isometric" ) {
14837-
mapSize = 10
14838-
// once we get the 'top' of the losange we need to remove half of the tile width.
14839-
this.pixelX = (this.baseWidth/2)*mapSize + (this.x - this.y) * this.baseWidth *0.5;
14837+
} else if (this.orientation === "isometric" ||true) {
14838+
// for the image to be centered we have to move the image to the right.
14839+
this.pixelX = this.layer.widthInPixels/2 + (this.x - this.y) * this.baseWidth *0.5;
1484014840
this.pixelY = (this.x + this.y) * this.baseHeight *0.5;
1484114841
console.log("isopix "+this.pixelX+","+this.pixelY)
14842-
console.log(self)
14842+
// console.log(this)
1484314843
} else {
14844-
console.log("self :" + self)
14845-
console.log("tile orientation 2: "+orientation)
14844+
console.log("this :" + this)
14845+
console.log("tile orientation 3: "+this.orientation)
1484614846
}
1484714847

1484814848
// this.pixelY = this.y * this.baseHeight - (this.height - this.baseHeight);

dist/phaser.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/tilemaps/Tile.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -732,13 +732,12 @@ var Tile = new Class({
732732
this.pixelX = this.x * this.baseWidth;
733733
this.pixelY = this.y * this.baseHeight;
734734
console.log("orthopix "+this.pixelX+","+this.pixelY)
735-
} else if (this.orientation === "isometric" ) {
736-
mapSize = 10
737-
// once we get the 'top' of the losange we need to remove half of the tile width.
738-
this.pixelX = (this.baseWidth/2)*mapSize + (this.x - this.y) * this.baseWidth *0.5;
735+
} else if (this.orientation === "isometric" ||true) {
736+
// for the image to be centered we have to move the image to the right.
737+
this.pixelX = this.layer.widthInPixels/2 + (this.x - this.y) * this.baseWidth *0.5;
739738
this.pixelY = (this.x + this.y) * this.baseHeight *0.5;
740739
console.log("isopix "+this.pixelX+","+this.pixelY)
741-
console.log(this)
740+
// console.log(this)
742741
} else {
743742
console.log("this :" + this)
744743
console.log("tile orientation 3: "+this.orientation)

0 commit comments

Comments
 (0)