diff --git a/cocos/2d/CCSprite.cpp b/cocos/2d/CCSprite.cpp index cc123e3a5d..b4be678d87 100644 --- a/cocos/2d/CCSprite.cpp +++ b/cocos/2d/CCSprite.cpp @@ -659,6 +659,16 @@ void Sprite::draw(void) // Node overrides +void Sprite::addChild(Node *child) +{ + Node::addChild(child); +} + +void Sprite::addChild(Node *child, int zOrder) +{ + Node::addChild(child, zOrder); +} + void Sprite::addChild(Node *child, int zOrder, int tag) { CCASSERT(child != NULL, "Argument must be non-NULL"); diff --git a/cocos/2d/CCSprite.h b/cocos/2d/CCSprite.h index f9d8d768f9..a78a120589 100644 --- a/cocos/2d/CCSprite.h +++ b/cocos/2d/CCSprite.h @@ -78,9 +78,6 @@ struct transformValues_; * The default anchorPoint in Sprite is (0.5, 0.5). */ class CC_DLL Sprite : public NodeRGBA, public TextureProtocol -#ifdef EMSCRIPTEN -, public GLBufferedNode -#endif // EMSCRIPTEN { public: @@ -412,7 +409,10 @@ public: virtual void removeChild(Node* child, bool cleanup) override; virtual void removeAllChildrenWithCleanup(bool cleanup) override; virtual void reorderChild(Node *child, int zOrder) override; - using Node::addChild; + // Should also override addChild(Node*) and addChild(Node*, int), or binding generator will only + // bind addChild(Node*, int, int); + virtual void addChild(Node* child) override; + virtual void addChild(Node* child, int zOrder) override; virtual void addChild(Node *child, int zOrder, int tag) override; virtual void sortAllChildren() override; virtual void setScale(float scale) override;