Skip to content

Commit e384724

Browse files
committed
Doesn't need to extend DoC, can extend DO instead.
1 parent 6661952 commit e384724

1 file changed

Lines changed: 15 additions & 5 deletions

File tree

src/pixi/extras/Tilemap.js

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* A PIXI WebGL Tilemap.
1010
*
1111
* @class PIXI.Tilemap
12-
* @extends {DisplayObjectContainer}
12+
* @extends {PIXI.DisplayObject}
1313
* @param {PIXI.Texture} texture - The tilemap texture.
1414
* @param {integer} displayWidth - The width of the display area. Used as the clipping limit for the shader.
1515
* @param {integer} displayHeight - The height of the display area. Used as the clipping limit for the shader.
@@ -21,7 +21,7 @@
2121
*/
2222
PIXI.Tilemap = function (texture, displayWidth, displayHeight, mapWidth, mapHeight, tileWidth, tileHeight, layer) {
2323

24-
PIXI.DisplayObjectContainer.call(this);
24+
PIXI.DisplayObject.call(this);
2525

2626
/**
2727
* The texture of the Tilemap
@@ -160,12 +160,21 @@ PIXI.Tilemap = function (texture, displayWidth, displayHeight, mapWidth, mapHeig
160160
*/
161161
this.buffer = new PIXI.Float32Array(mapWidth * mapHeight * this.batchDataElement);
162162

163+
/**
164+
* A required but un-used array.
165+
* Do not add objects to this array, Tilemaps cannot have children.
166+
*
167+
* @property children
168+
* @type Array
169+
* @private
170+
*/
171+
this.children = [];
172+
163173
};
164174

165-
PIXI.Tilemap.prototype = Object.create(PIXI.DisplayObjectContainer.prototype);
175+
PIXI.Tilemap.prototype = Object.create(PIXI.DisplayObject.prototype);
166176
PIXI.Tilemap.prototype.constructor = PIXI.Tilemap;
167177

168-
// unused methods overridden to prevent default behavior
169178
PIXI.Tilemap.prototype.update = function () {};
170179
PIXI.Tilemap.prototype.postUpdate = function () {};
171180

@@ -395,9 +404,10 @@ PIXI.Tilemap.prototype._renderWholeTilemap = function (renderSession) {
395404
* @method onTextureUpdate
396405
* @param event
397406
* @private
398-
*/
399407
PIXI.Tilemap.prototype.onTextureUpdate = function () {
400408
401409
this.updateFrame = true;
402410
403411
};
412+
*/
413+

0 commit comments

Comments
 (0)