diff --git a/src/pixi/extras/TilingSprite.js b/src/pixi/extras/TilingSprite.js index 35954f2..1c054b2 100644 --- a/src/pixi/extras/TilingSprite.js +++ b/src/pixi/extras/TilingSprite.js @@ -56,7 +56,6 @@ */ this.tilePosition = new PIXI.Point(0,0); - /** * Whether this sprite is renderable or not * @@ -121,45 +120,14 @@ } }); -/** - * When the texture is updated, this event will be fired to update the scale and frame - * - * @method onTextureUpdate - * @param event - * @private - */ -PIXI.TilingSprite.prototype.onTextureUpdate = function() -{ - //this.updateFrame = true; -}; - PIXI.TilingSprite.prototype.setTexture = function(texture) { - if(this.texture === texture)return; + if (this.texture === texture) return; this.texture = texture; this.refreshTexture = true; - /* - if(this.tilingTexture) - { - this.generateTilingTexture(true); - } -*/ - /* - // stop current texture; - if(this.texture.baseTexture !== texture.baseTexture) - { - this.textureChange = true; - this.texture = texture; - } - else - { - this.texture = texture; - } - - this.updateFrame = true;*/ this.cachedTint = 0xFFFFFF; }; @@ -172,29 +140,28 @@ */ PIXI.TilingSprite.prototype._renderWebGL = function(renderSession) { - - if(this.visible === false || this.alpha === 0)return; + if (this.visible === false || this.alpha === 0) return; var i,j; - if(this.mask) + if (this.mask) { renderSession.spriteBatch.stop(); renderSession.maskManager.pushMask(this.mask, renderSession); renderSession.spriteBatch.start(); } - if(this.filters) + if (this.filters) { renderSession.spriteBatch.flush(); renderSession.filterManager.pushFilter(this._filterBlock); } - - if(!this.tilingTexture || this.refreshTexture) + if (!this.tilingTexture || this.refreshTexture) { this.generateTilingTexture(true); - if(this.tilingTexture && this.tilingTexture.needsUpdate) + + if (this.tilingTexture && this.tilingTexture.needsUpdate) { //TODO - tweaking PIXI.updateWebGLTexture(this.tilingTexture.baseTexture, renderSession.gl); @@ -202,19 +169,21 @@ // this.tilingTexture._uvs = null; } } - else renderSession.spriteBatch.renderTilingSprite(this); - + else + { + renderSession.spriteBatch.renderTilingSprite(this); + } // simple render children! - for(i=0,j=this.children.length; i