mirror of
https://github.com/wassname/phaser.git
synced 2026-07-29 11:24:31 +08:00
Preparing for 1.0.6 release, but moving physics changes to dev.
This commit is contained in:
@@ -138,6 +138,8 @@ Phaser.Tilemap.prototype.parseTiledJSON = function (json, key) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// layer.createQuadTree(json.tilewidth * json.layers[i].width, json.tileheight * json.layers[i].height);
|
||||
|
||||
layer.alpha = json.layers[i].opacity;
|
||||
layer.visible = json.layers[i].visible;
|
||||
layer.tileMargin = json.tilesets[0].margin;
|
||||
@@ -183,8 +185,6 @@ Phaser.Tilemap.prototype.parseTiledJSON = function (json, key) {
|
||||
*/
|
||||
Phaser.Tilemap.prototype.generateTiles = function (qty) {
|
||||
|
||||
console.log('generating', qty, 'tiles');
|
||||
|
||||
for (var i = 0; i < qty; i++)
|
||||
{
|
||||
this.tiles.push(new Phaser.Tile(this.game, this, i, this.currentLayer.tileWidth, this.currentLayer.tileHeight));
|
||||
|
||||
@@ -87,6 +87,8 @@ Phaser.TilemapLayer = function (parent, id, key, mapFormat, name, tileWidth, til
|
||||
|
||||
this._alpha = 1;
|
||||
|
||||
this.quadTree = null;
|
||||
|
||||
this.canvas = null;
|
||||
this.context = null;
|
||||
this.baseTexture = null;
|
||||
@@ -472,6 +474,12 @@ Phaser.TilemapLayer.prototype = {
|
||||
|
||||
this.parent.addChild(this.sprite);
|
||||
|
||||
},
|
||||
|
||||
createQuadTree: function (width, height) {
|
||||
|
||||
this.quadTree = new Phaser.QuadTree(this, 0, 0, width, height, 20, 4);
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
|
||||
@@ -112,8 +112,15 @@ Phaser.TilemapRenderer.prototype = {
|
||||
layer.tileWidth,
|
||||
layer.tileHeight
|
||||
);
|
||||
|
||||
if (tilemap.tiles[this._columnData[tile]].collideNone == false)
|
||||
{
|
||||
layer.context.fillStyle = 'rgba(255,255,0,0.5)';
|
||||
layer.context.fillRect(this._tx, this._ty, layer.tileWidth, layer.tileHeight);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
this._tx += layer.tileWidth;
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user