Skip to content

Commit 8832680

Browse files
committed
Exposed 'width' and 'height' properties on TilemapLayer, so it can be resized and update all children.
1 parent ed9793e commit 8832680

2 files changed

Lines changed: 14 additions & 14 deletions

File tree

src/pixi/extras/Tilemap.js

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -52,50 +52,50 @@ PIXI.Tilemap = function (texture, displayWidth, displayHeight, mapWidth, mapHeig
5252
/**
5353
* The width of a single tile in pixels.
5454
*
55-
* @property tileWide
55+
* @property tileWidth
5656
* @type integer
5757
*/
58-
this.tileWide = tileWidth;
58+
this.tileWidth = tileWidth;
5959

6060
/**
6161
* The height of a single tile in pixels.
6262
*
63-
* @property tileHigh
63+
* @property tileHeight
6464
* @type integer
6565
*/
66-
this.tileHigh = tileHeight;
66+
this.tileHeight = tileHeight;
6767

6868
/**
6969
* The width of the map in tiles.
7070
*
71-
* @property mapWide
71+
* @property mapWidth
7272
* @type integer
7373
*/
74-
this.mapWide = mapWidth;
74+
this.mapWidth = mapWidth;
7575

7676
/**
7777
* The height of the map in tiles.
7878
*
79-
* @property mapHigh
79+
* @property mapHeight
8080
* @type integer
8181
*/
82-
this.mapHigh = mapHeight;
82+
this.mapHeight = mapHeight;
8383

8484
/**
8585
* The width of the map in pixels.
8686
*
8787
* @property width
8888
* @type integer
8989
*/
90-
this.width = this.mapWide * this.tileWide;
90+
this.pxWidth = this.mapWidth * this.tileWidth;
9191

9292
/**
9393
* The height of the map in pixels.
9494
*
9595
* @property height
9696
* @type integer
9797
*/
98-
this.height = this.mapHigh * this.tileHigh;
98+
this.pxHeight = this.mapHeight * this.tileHeight;
9999

100100
/**
101101
* Tilemap layer data from the map, arranged in mapHeight lists of mapWidth tiles.
@@ -238,8 +238,8 @@ PIXI.Tilemap.prototype._renderBatch = function (renderSession) {
238238
var iWide = 1.0 / screenWide2;
239239
var iHigh = 1.0 / screenHigh2;
240240

241-
var wide = this.tileWide * 0.5 / screenWide2;
242-
var high = this.tileHigh * 0.5 / screenHigh2;
241+
var wide = this.tileWidth * 0.5 / screenWide2;
242+
var high = this.tileHeight * 0.5 / screenHigh2;
243243

244244
var buffer = this.buffer;
245245
var oldR, oldT, uvl, uvt;

src/tilemap/TilemapLayerGL.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -827,7 +827,7 @@ Object.defineProperty(Phaser.TilemapLayerGL.prototype, "y", {
827827

828828
});
829829

830-
Object.defineProperty(Phaser.TilemapLayerGL.prototype, "displayWidth", {
830+
Object.defineProperty(Phaser.TilemapLayerGL.prototype, "width", {
831831

832832
get: function () {
833833

@@ -850,7 +850,7 @@ Object.defineProperty(Phaser.TilemapLayerGL.prototype, "displayWidth", {
850850

851851
});
852852

853-
Object.defineProperty(Phaser.TilemapLayerGL.prototype, "displayHeight", {
853+
Object.defineProperty(Phaser.TilemapLayerGL.prototype, "height", {
854854

855855
get: function () {
856856

0 commit comments

Comments
 (0)