preparing WIP PR

This commit is contained in:
Svipal 2020-01-29 19:20:25 +01:00
parent a82b27ce6f
commit ccbff39074
5 changed files with 32 additions and 33 deletions

View file

@ -12182,9 +12182,9 @@ module.exports = SetTileCollision;
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
var Class = __webpack_require__(0);
var Components = __webpack_require__(11);
var Rectangle = __webpack_require__(441);
var Class = __webpack_require__(0);
var Components = __webpack_require__(11);
var Rectangle = __webpack_require__(441);
/**
* @classdesc
@ -12456,7 +12456,7 @@ var Tile = new Class({
*/
this.physics = {};
/**
* An empty object where physics-engine specific information (e.g. bodies) may be stored.
* The tile's orientation, necessary to be able to determine pixelX and pixelY.
*
* @name Phaser.Tilemaps.Tile#orientation
* @type {string}
@ -12467,7 +12467,7 @@ var Tile = new Class({
if (orientation == undefined) {
this.orientation = "orthogonal";
} else {
this.orientation = orientation // (' ' + orientation).slice(1)
this.orientation = (' ' + orientation).slice(1)
}
console.log("tile orientation : "+this.orientation)
},
@ -12902,23 +12902,23 @@ var Tile = new Class({
*/
updatePixelXY: function ()
{
if (orientation === "orthogonal") {
console.log("tile orientation 2: "+this.orientation)
if (this.orientation === "orthogonal") {
// In orthogonal mode, Tiled places tiles on a grid of baseWidth x baseHeight. The origin for a tile is the
// bottom left, while the Phaser renderer assumes the origin is the top left. The y
// coordinate needs to be adjusted by the difference.
this.pixelX = this.x * this.baseWidth;
this.pixelY = this.y * this.baseHeight;
console.log("orthopix "+this.pixelX+","+this.pixelY)
} else if (orientation === "isometric" ) {
mapSize = 10
// once we get the 'top' of the losange we need to remove half of the tile width.
this.pixelX = (this.baseWidth/2)*mapSize + (this.x - this.y) * this.baseWidth *0.5;
} 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;
this.pixelY = (this.x + this.y) * this.baseHeight *0.5;
console.log("isopix "+this.pixelX+","+this.pixelY)
console.log(self)
// console.log(this)
} else {
console.log("self :" + self)
console.log("tile orientation 2: "+orientation)
console.log("this :" + this)
console.log("tile orientation 3: "+this.orientation)
}
// this.pixelY = this.y * this.baseHeight - (this.height - this.baseHeight);

File diff suppressed because one or more lines are too long

26
dist/phaser.js vendored
View file

@ -14106,9 +14106,9 @@ module.exports = SetTileCollision;
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
var Class = __webpack_require__(0);
var Components = __webpack_require__(11);
var Rectangle = __webpack_require__(441);
var Class = __webpack_require__(0);
var Components = __webpack_require__(11);
var Rectangle = __webpack_require__(441);
/**
* @classdesc
@ -14380,7 +14380,7 @@ var Tile = new Class({
*/
this.physics = {};
/**
* An empty object where physics-engine specific information (e.g. bodies) may be stored.
* The tile's orientation, necessary to be able to determine pixelX and pixelY.
*
* @name Phaser.Tilemaps.Tile#orientation
* @type {string}
@ -14391,7 +14391,7 @@ var Tile = new Class({
if (orientation == undefined) {
this.orientation = "orthogonal";
} else {
this.orientation = orientation // (' ' + orientation).slice(1)
this.orientation = (' ' + orientation).slice(1)
}
console.log("tile orientation : "+this.orientation)
},
@ -14826,23 +14826,23 @@ var Tile = new Class({
*/
updatePixelXY: function ()
{
if (orientation === "orthogonal") {
console.log("tile orientation 2: "+this.orientation)
if (this.orientation === "orthogonal") {
// In orthogonal mode, Tiled places tiles on a grid of baseWidth x baseHeight. The origin for a tile is the
// bottom left, while the Phaser renderer assumes the origin is the top left. The y
// coordinate needs to be adjusted by the difference.
this.pixelX = this.x * this.baseWidth;
this.pixelY = this.y * this.baseHeight;
console.log("orthopix "+this.pixelX+","+this.pixelY)
} else if (orientation === "isometric" ) {
mapSize = 10
// once we get the 'top' of the losange we need to remove half of the tile width.
this.pixelX = (this.baseWidth/2)*mapSize + (this.x - this.y) * this.baseWidth *0.5;
} 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;
this.pixelY = (this.x + this.y) * this.baseHeight *0.5;
console.log("isopix "+this.pixelX+","+this.pixelY)
console.log(self)
// console.log(this)
} else {
console.log("self :" + self)
console.log("tile orientation 2: "+orientation)
console.log("this :" + this)
console.log("tile orientation 3: "+this.orientation)
}
// this.pixelY = this.y * this.baseHeight - (this.height - this.baseHeight);

2
dist/phaser.min.js vendored

File diff suppressed because one or more lines are too long

View file

@ -732,13 +732,12 @@ var Tile = new Class({
this.pixelX = this.x * this.baseWidth;
this.pixelY = this.y * this.baseHeight;
console.log("orthopix "+this.pixelX+","+this.pixelY)
} else if (this.orientation === "isometric" ) {
mapSize = 10
// once we get the 'top' of the losange we need to remove half of the tile width.
this.pixelX = (this.baseWidth/2)*mapSize + (this.x - this.y) * this.baseWidth *0.5;
} 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;
this.pixelY = (this.x + this.y) * this.baseHeight *0.5;
console.log("isopix "+this.pixelX+","+this.pixelY)
console.log(this)
// console.log(this)
} else {
console.log("this :" + this)
console.log("tile orientation 3: "+this.orientation)