From 8832680aa03ac0412ed32d54217d22147a3e4b67 Mon Sep 17 00:00:00 2001 From: Richard Davey Date: Fri, 22 Jul 2016 00:09:31 +0100 Subject: [PATCH] Exposed 'width' and 'height' properties on TilemapLayer, so it can be resized and update all children. --- src/pixi/extras/Tilemap.js | 24 ++++++++++++------------ src/tilemap/TilemapLayerGL.js | 4 ++-- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/pixi/extras/Tilemap.js b/src/pixi/extras/Tilemap.js index 0b9df9558..7efe9b8d9 100644 --- a/src/pixi/extras/Tilemap.js +++ b/src/pixi/extras/Tilemap.js @@ -52,34 +52,34 @@ PIXI.Tilemap = function (texture, displayWidth, displayHeight, mapWidth, mapHeig /** * The width of a single tile in pixels. * - * @property tileWide + * @property tileWidth * @type integer */ - this.tileWide = tileWidth; + this.tileWidth = tileWidth; /** * The height of a single tile in pixels. * - * @property tileHigh + * @property tileHeight * @type integer */ - this.tileHigh = tileHeight; + this.tileHeight = tileHeight; /** * The width of the map in tiles. * - * @property mapWide + * @property mapWidth * @type integer */ - this.mapWide = mapWidth; + this.mapWidth = mapWidth; /** * The height of the map in tiles. * - * @property mapHigh + * @property mapHeight * @type integer */ - this.mapHigh = mapHeight; + this.mapHeight = mapHeight; /** * The width of the map in pixels. @@ -87,7 +87,7 @@ PIXI.Tilemap = function (texture, displayWidth, displayHeight, mapWidth, mapHeig * @property width * @type integer */ - this.width = this.mapWide * this.tileWide; + this.pxWidth = this.mapWidth * this.tileWidth; /** * The height of the map in pixels. @@ -95,7 +95,7 @@ PIXI.Tilemap = function (texture, displayWidth, displayHeight, mapWidth, mapHeig * @property height * @type integer */ - this.height = this.mapHigh * this.tileHigh; + this.pxHeight = this.mapHeight * this.tileHeight; /** * Tilemap layer data from the map, arranged in mapHeight lists of mapWidth tiles. @@ -238,8 +238,8 @@ PIXI.Tilemap.prototype._renderBatch = function (renderSession) { var iWide = 1.0 / screenWide2; var iHigh = 1.0 / screenHigh2; - var wide = this.tileWide * 0.5 / screenWide2; - var high = this.tileHigh * 0.5 / screenHigh2; + var wide = this.tileWidth * 0.5 / screenWide2; + var high = this.tileHeight * 0.5 / screenHigh2; var buffer = this.buffer; var oldR, oldT, uvl, uvt; diff --git a/src/tilemap/TilemapLayerGL.js b/src/tilemap/TilemapLayerGL.js index 637eecebf..4ee5ae602 100644 --- a/src/tilemap/TilemapLayerGL.js +++ b/src/tilemap/TilemapLayerGL.js @@ -827,7 +827,7 @@ Object.defineProperty(Phaser.TilemapLayerGL.prototype, "y", { }); -Object.defineProperty(Phaser.TilemapLayerGL.prototype, "displayWidth", { +Object.defineProperty(Phaser.TilemapLayerGL.prototype, "width", { get: function () { @@ -850,7 +850,7 @@ Object.defineProperty(Phaser.TilemapLayerGL.prototype, "displayWidth", { }); -Object.defineProperty(Phaser.TilemapLayerGL.prototype, "displayHeight", { +Object.defineProperty(Phaser.TilemapLayerGL.prototype, "height", { get: function () {