diff --git a/src/pixi/display/Sprite.js b/src/pixi/display/Sprite.js index 5f0b664..aa9580e 100644 --- a/src/pixi/display/Sprite.js +++ b/src/pixi/display/Sprite.js @@ -9,8 +9,8 @@ * @extends DisplayObjectContainer * @constructor * @param texture {Texture} The texture for this sprite - * - * A sprite can be created directly from an image like this : + * + * A sprite can be created directly from an image like this : * var sprite = new PIXI.Sprite.fromImage('assets/image.png'); * yourStage.addChild(sprite); * then obviously don't forget to add it to the stage you have already created @@ -64,7 +64,7 @@ * @default 0xFFFFFF */ this.tint = 0xFFFFFF; - + /** * The blend mode to be applied to the sprite. Set to PIXI.blendModes.NORMAL to remove any blend mode. * @@ -89,8 +89,7 @@ } else { - this.onTextureUpdateBind = this.onTextureUpdate.bind(this); - this.texture.on( 'update', this.onTextureUpdateBind ); + this.texture.on( 'update', this.onTextureUpdate.bind(this) ); } this.renderable = true; @@ -244,14 +243,14 @@ * Renders the object using the WebGL renderer * * @method _renderWebGL -* @param renderSession {RenderSession} +* @param renderSession {RenderSession} * @private */ PIXI.Sprite.prototype._renderWebGL = function(renderSession) { // if the sprite is not visible or the alpha is 0 then no need to render this element if(!this.visible || this.alpha <= 0)return; - + var i,j; // do a quick check to see if this element has a mask or a filter. @@ -287,7 +286,7 @@ if(this._mask)renderSession.maskManager.popMask(this._mask, renderSession); if(this._filters)renderSession.filterManager.popFilter(); - + spriteBatch.start(); } else @@ -299,7 +298,7 @@ { this.children[i]._renderWebGL(renderSession); } - + } }; @@ -307,14 +306,14 @@ * Renders the object using the Canvas renderer * * @method _renderCanvas -* @param renderSession {RenderSession} +* @param renderSession {RenderSession} * @private */ PIXI.Sprite.prototype._renderCanvas = function(renderSession) { // If the sprite is not visible or the alpha is 0 then no need to render this element if (this.visible === false || this.alpha === 0 || this.texture.crop.width <= 0 || this.texture.crop.height <= 0) return; - + if (this.blendMode !== renderSession.currentBlendMode) { renderSession.currentBlendMode = this.blendMode; @@ -371,7 +370,7 @@ if (this.cachedTint !== this.tint) { this.cachedTint = this.tint; - + // TODO clean up caching - how to clean up the caches? this.tintedTexture = PIXI.CanvasTinter.getTintedTexture(this, this.tint); }