From 960b4d202d14d04848281b0d0d94b1ffeea296d6 Mon Sep 17 00:00:00 2001 From: dingpinglv Date: Wed, 19 Mar 2014 14:37:49 +0800 Subject: [PATCH] Fixed a bug of Sprite that it doesn't work when its texture doesn't preload and its parent is a SpriteBatchNode --- cocos2d/core/sprite_nodes/CCSprite.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cocos2d/core/sprite_nodes/CCSprite.js b/cocos2d/core/sprite_nodes/CCSprite.js index ce285eb3bf..3e31cce561 100644 --- a/cocos2d/core/sprite_nodes/CCSprite.js +++ b/cocos2d/core/sprite_nodes/CCSprite.js @@ -1307,7 +1307,7 @@ cc.Sprite = cc.NodeRGBA.extend(/** @lends cc.Sprite# */{ // by default use "Self Render". // if the sprite is added to a batchnode, then it will automatically switch to "batchnode Render" - this.setBatchNode(null); + this.setBatchNode(this._batchNode); this._quadDirty = true; this._callLoadedEventCallbacks(); }, @@ -1333,7 +1333,7 @@ cc.Sprite = cc.NodeRGBA.extend(/** @lends cc.Sprite# */{ // by default use "Self Render". // if the sprite is added to a batchnode, then it will automatically switch to "batchnode Render" - this.setBatchNode(null); + this.setBatchNode(this._batchNode); this._callLoadedEventCallbacks(); },