sourcemars / cocos2d-android-1

Automatically exported from code.google.com/p/cocos2d-android-1
0 stars 0 forks source link

CCSprite Improperly Overrides addChild #30

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
The CCSprite's addChild implementation takes a CCSprite whereas CCNode's takes 
a CCNode. This causes the overridden CCSprite's method to not be called in 
certain cases where it should be.

For instance, if you call addChild(CCNode node) on a sprite, the hasChildren_ = 
true; property is never set which creates problems especially with sprite 
sheets.

The fix would be to make the CCSprite method take a CCNode and have additional 
type checking inside the method.

Original issue reported on code.google.com by ghemp...@gmail.com on 20 Dec 2010 at 3:53