mirror of
https://github.com/photonstorm/phaser
synced 2024-12-23 03:23:42 +00:00
preparing WIP PR
This commit is contained in:
parent
a82b27ce6f
commit
ccbff39074
5 changed files with 32 additions and 33 deletions
20
dist/phaser-arcade-physics.js
vendored
20
dist/phaser-arcade-physics.js
vendored
|
@ -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);
|
||||
|
|
2
dist/phaser-arcade-physics.min.js
vendored
2
dist/phaser-arcade-physics.min.js
vendored
File diff suppressed because one or more lines are too long
20
dist/phaser.js
vendored
20
dist/phaser.js
vendored
|
@ -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
2
dist/phaser.min.js
vendored
File diff suppressed because one or more lines are too long
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue