Skip to content

Commit 6d8fb60

Browse files
committed
Removed TilemapLayer.index getter as it incorrectly refereneced a property that didn't exist, breaking most demos. Couldn't see an obvious reason for the getter so restored previous property and tested all examples, and all run now (and faster too thanks to the rest of the changes made in TilemapLayer).
1 parent b250e61 commit 6d8fb60

1 file changed

Lines changed: 8 additions & 16 deletions

File tree

src/tilemap/TilemapLayer.js

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,14 @@ Phaser.TilemapLayer = function (game, tilemap, index, width, height) {
3939
*/
4040
this.map = tilemap;
4141

42+
/**
43+
* The index of this layer within the Tilemap.
44+
* @property {number} index
45+
* @protected
46+
* @readonly
47+
*/
48+
this.index = index;
49+
4250
/**
4351
* The layer object within the Tilemap that this layer represents.
4452
* @property {Phaser.TileLayer} layer
@@ -253,22 +261,6 @@ Phaser.TilemapLayer = function (game, tilemap, index, width, height) {
253261
Phaser.TilemapLayer.prototype = Object.create(Phaser.Image.prototype);
254262
Phaser.TilemapLayer.prototype.constructor = Phaser.TilemapLayer;
255263

256-
/**
257-
* The index of this layer (`layer`) within the Tilemap.
258-
*
259-
* @property {integer} index
260-
* @memberof Phaser.TilemapLayer
261-
* @readonly
262-
* @protected
263-
*/
264-
Object.defineProperty(Phaser.TilemapLayer.prototype, 'index', {
265-
266-
get: function () {
267-
return this.layer.layerIndex;
268-
}
269-
270-
});
271-
272264
/**
273265
* If no valid tileset/image can be found for a tile, the tile is rendered as a rectangle using this as a fill value.
274266
*

0 commit comments

Comments
 (0)