mirror of
https://github.com/photonstorm/phaser
synced 2024-12-23 11:33:28 +00:00
preparing WIP PR
This commit is contained in:
parent
a82b27ce6f
commit
ccbff39074
5 changed files with 32 additions and 33 deletions
26
dist/phaser-arcade-physics.js
vendored
26
dist/phaser-arcade-physics.js
vendored
|
@ -12182,9 +12182,9 @@ module.exports = SetTileCollision;
|
||||||
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
var Class = __webpack_require__(0);
|
var Class = __webpack_require__(0);
|
||||||
var Components = __webpack_require__(11);
|
var Components = __webpack_require__(11);
|
||||||
var Rectangle = __webpack_require__(441);
|
var Rectangle = __webpack_require__(441);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @classdesc
|
* @classdesc
|
||||||
|
@ -12456,7 +12456,7 @@ var Tile = new Class({
|
||||||
*/
|
*/
|
||||||
this.physics = {};
|
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
|
* @name Phaser.Tilemaps.Tile#orientation
|
||||||
* @type {string}
|
* @type {string}
|
||||||
|
@ -12467,7 +12467,7 @@ var Tile = new Class({
|
||||||
if (orientation == undefined) {
|
if (orientation == undefined) {
|
||||||
this.orientation = "orthogonal";
|
this.orientation = "orthogonal";
|
||||||
} else {
|
} else {
|
||||||
this.orientation = orientation // (' ' + orientation).slice(1)
|
this.orientation = (' ' + orientation).slice(1)
|
||||||
}
|
}
|
||||||
console.log("tile orientation : "+this.orientation)
|
console.log("tile orientation : "+this.orientation)
|
||||||
},
|
},
|
||||||
|
@ -12902,23 +12902,23 @@ var Tile = new Class({
|
||||||
*/
|
*/
|
||||||
updatePixelXY: function ()
|
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
|
// 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
|
// bottom left, while the Phaser renderer assumes the origin is the top left. The y
|
||||||
// coordinate needs to be adjusted by the difference.
|
// coordinate needs to be adjusted by the difference.
|
||||||
this.pixelX = this.x * this.baseWidth;
|
this.pixelX = this.x * this.baseWidth;
|
||||||
this.pixelY = this.y * this.baseHeight;
|
this.pixelY = this.y * this.baseHeight;
|
||||||
console.log("orthopix "+this.pixelX+","+this.pixelY)
|
console.log("orthopix "+this.pixelX+","+this.pixelY)
|
||||||
} else if (orientation === "isometric" ) {
|
} else if (this.orientation === "isometric" ||true) {
|
||||||
mapSize = 10
|
// for the image to be centered we have to move the image to the right.
|
||||||
// once we get the 'top' of the losange we need to remove half of the tile width.
|
this.pixelX = this.layer.widthInPixels/2 + (this.x - this.y) * this.baseWidth *0.5;
|
||||||
this.pixelX = (this.baseWidth/2)*mapSize + (this.x - this.y) * this.baseWidth *0.5;
|
|
||||||
this.pixelY = (this.x + this.y) * this.baseHeight *0.5;
|
this.pixelY = (this.x + this.y) * this.baseHeight *0.5;
|
||||||
console.log("isopix "+this.pixelX+","+this.pixelY)
|
console.log("isopix "+this.pixelX+","+this.pixelY)
|
||||||
console.log(self)
|
// console.log(this)
|
||||||
} else {
|
} else {
|
||||||
console.log("self :" + self)
|
console.log("this :" + this)
|
||||||
console.log("tile orientation 2: "+orientation)
|
console.log("tile orientation 3: "+this.orientation)
|
||||||
}
|
}
|
||||||
|
|
||||||
// this.pixelY = this.y * this.baseHeight - (this.height - this.baseHeight);
|
// 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
26
dist/phaser.js
vendored
26
dist/phaser.js
vendored
|
@ -14106,9 +14106,9 @@ module.exports = SetTileCollision;
|
||||||
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
var Class = __webpack_require__(0);
|
var Class = __webpack_require__(0);
|
||||||
var Components = __webpack_require__(11);
|
var Components = __webpack_require__(11);
|
||||||
var Rectangle = __webpack_require__(441);
|
var Rectangle = __webpack_require__(441);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @classdesc
|
* @classdesc
|
||||||
|
@ -14380,7 +14380,7 @@ var Tile = new Class({
|
||||||
*/
|
*/
|
||||||
this.physics = {};
|
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
|
* @name Phaser.Tilemaps.Tile#orientation
|
||||||
* @type {string}
|
* @type {string}
|
||||||
|
@ -14391,7 +14391,7 @@ var Tile = new Class({
|
||||||
if (orientation == undefined) {
|
if (orientation == undefined) {
|
||||||
this.orientation = "orthogonal";
|
this.orientation = "orthogonal";
|
||||||
} else {
|
} else {
|
||||||
this.orientation = orientation // (' ' + orientation).slice(1)
|
this.orientation = (' ' + orientation).slice(1)
|
||||||
}
|
}
|
||||||
console.log("tile orientation : "+this.orientation)
|
console.log("tile orientation : "+this.orientation)
|
||||||
},
|
},
|
||||||
|
@ -14826,23 +14826,23 @@ var Tile = new Class({
|
||||||
*/
|
*/
|
||||||
updatePixelXY: function ()
|
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
|
// 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
|
// bottom left, while the Phaser renderer assumes the origin is the top left. The y
|
||||||
// coordinate needs to be adjusted by the difference.
|
// coordinate needs to be adjusted by the difference.
|
||||||
this.pixelX = this.x * this.baseWidth;
|
this.pixelX = this.x * this.baseWidth;
|
||||||
this.pixelY = this.y * this.baseHeight;
|
this.pixelY = this.y * this.baseHeight;
|
||||||
console.log("orthopix "+this.pixelX+","+this.pixelY)
|
console.log("orthopix "+this.pixelX+","+this.pixelY)
|
||||||
} else if (orientation === "isometric" ) {
|
} else if (this.orientation === "isometric" ||true) {
|
||||||
mapSize = 10
|
// for the image to be centered we have to move the image to the right.
|
||||||
// once we get the 'top' of the losange we need to remove half of the tile width.
|
this.pixelX = this.layer.widthInPixels/2 + (this.x - this.y) * this.baseWidth *0.5;
|
||||||
this.pixelX = (this.baseWidth/2)*mapSize + (this.x - this.y) * this.baseWidth *0.5;
|
|
||||||
this.pixelY = (this.x + this.y) * this.baseHeight *0.5;
|
this.pixelY = (this.x + this.y) * this.baseHeight *0.5;
|
||||||
console.log("isopix "+this.pixelX+","+this.pixelY)
|
console.log("isopix "+this.pixelX+","+this.pixelY)
|
||||||
console.log(self)
|
// console.log(this)
|
||||||
} else {
|
} else {
|
||||||
console.log("self :" + self)
|
console.log("this :" + this)
|
||||||
console.log("tile orientation 2: "+orientation)
|
console.log("tile orientation 3: "+this.orientation)
|
||||||
}
|
}
|
||||||
|
|
||||||
// this.pixelY = this.y * this.baseHeight - (this.height - this.baseHeight);
|
// 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.pixelX = this.x * this.baseWidth;
|
||||||
this.pixelY = this.y * this.baseHeight;
|
this.pixelY = this.y * this.baseHeight;
|
||||||
console.log("orthopix "+this.pixelX+","+this.pixelY)
|
console.log("orthopix "+this.pixelX+","+this.pixelY)
|
||||||
} else if (this.orientation === "isometric" ) {
|
} else if (this.orientation === "isometric" ||true) {
|
||||||
mapSize = 10
|
// for the image to be centered we have to move the image to the right.
|
||||||
// once we get the 'top' of the losange we need to remove half of the tile width.
|
this.pixelX = this.layer.widthInPixels/2 + (this.x - this.y) * this.baseWidth *0.5;
|
||||||
this.pixelX = (this.baseWidth/2)*mapSize + (this.x - this.y) * this.baseWidth *0.5;
|
|
||||||
this.pixelY = (this.x + this.y) * this.baseHeight *0.5;
|
this.pixelY = (this.x + this.y) * this.baseHeight *0.5;
|
||||||
console.log("isopix "+this.pixelX+","+this.pixelY)
|
console.log("isopix "+this.pixelX+","+this.pixelY)
|
||||||
console.log(this)
|
// console.log(this)
|
||||||
} else {
|
} else {
|
||||||
console.log("this :" + this)
|
console.log("this :" + this)
|
||||||
console.log("tile orientation 3: "+this.orientation)
|
console.log("tile orientation 3: "+this.orientation)
|
||||||
|
|
Loading…
Reference in a new issue