99 * @extends DisplayObjectContainer
1010 * @constructor
1111 * @param texture {Texture} The texture for this sprite
12- *
13- * A sprite can be created directly from an image like this :
12+ *
13+ * A sprite can be created directly from an image like this :
1414 * var sprite = new PIXI.Sprite.fromImage('assets/image.png');
1515 * yourStage.addChild(sprite);
1616 * then obviously don't forget to add it to the stage you have already created
@@ -64,7 +64,7 @@ PIXI.Sprite = function(texture)
6464 * @default 0xFFFFFF
6565 */
6666 this . tint = 0xFFFFFF ;
67-
67+
6868 /**
6969 * The blend mode to be applied to the sprite. Set to PIXI.blendModes.NORMAL to remove any blend mode.
7070 *
@@ -89,8 +89,7 @@ PIXI.Sprite = function(texture)
8989 }
9090 else
9191 {
92- this . onTextureUpdateBind = this . onTextureUpdate . bind ( this ) ;
93- this . texture . on ( 'update' , this . onTextureUpdateBind ) ;
92+ this . texture . on ( 'update' , this . onTextureUpdate . bind ( this ) ) ;
9493 }
9594
9695 this . renderable = true ;
@@ -244,14 +243,14 @@ PIXI.Sprite.prototype.getBounds = function(matrix)
244243* Renders the object using the WebGL renderer
245244*
246245* @method _renderWebGL
247- * @param renderSession {RenderSession}
246+ * @param renderSession {RenderSession}
248247* @private
249248*/
250249PIXI . Sprite . prototype . _renderWebGL = function ( renderSession )
251250{
252251 // if the sprite is not visible or the alpha is 0 then no need to render this element
253252 if ( ! this . visible || this . alpha <= 0 ) return ;
254-
253+
255254 var i , j ;
256255
257256 // do a quick check to see if this element has a mask or a filter.
@@ -287,7 +286,7 @@ PIXI.Sprite.prototype._renderWebGL = function(renderSession)
287286
288287 if ( this . _mask ) renderSession . maskManager . popMask ( this . _mask , renderSession ) ;
289288 if ( this . _filters ) renderSession . filterManager . popFilter ( ) ;
290-
289+
291290 spriteBatch . start ( ) ;
292291 }
293292 else
@@ -299,22 +298,22 @@ PIXI.Sprite.prototype._renderWebGL = function(renderSession)
299298 {
300299 this . children [ i ] . _renderWebGL ( renderSession ) ;
301300 }
302-
301+
303302 }
304303} ;
305304
306305/**
307306* Renders the object using the Canvas renderer
308307*
309308* @method _renderCanvas
310- * @param renderSession {RenderSession}
309+ * @param renderSession {RenderSession}
311310* @private
312311*/
313312PIXI . Sprite . prototype . _renderCanvas = function ( renderSession )
314313{
315314 // If the sprite is not visible or the alpha is 0 then no need to render this element
316315 if ( this . visible === false || this . alpha === 0 || this . texture . crop . width <= 0 || this . texture . crop . height <= 0 ) return ;
317-
316+
318317 if ( this . blendMode !== renderSession . currentBlendMode )
319318 {
320319 renderSession . currentBlendMode = this . blendMode ;
@@ -371,7 +370,7 @@ PIXI.Sprite.prototype._renderCanvas = function(renderSession)
371370 if ( this . cachedTint !== this . tint )
372371 {
373372 this . cachedTint = this . tint ;
374-
373+
375374 // TODO clean up caching - how to clean up the caches?
376375 this . tintedTexture = PIXI . CanvasTinter . getTintedTexture ( this , this . tint ) ;
377376 }
0 commit comments