diff --git a/native/cocos/2d/CCLabel.cpp b/native/cocos/2d/CCLabel.cpp index 6793c3e249..dda9f472c8 100644 --- a/native/cocos/2d/CCLabel.cpp +++ b/native/cocos/2d/CCLabel.cpp @@ -169,6 +169,11 @@ private: bool _letterVisible; }; +void Label::setColor(const cocos2d::Color3B &color) +{ + this->setTextColor(Color4B(color)); +} + Label* Label::create() { auto ret = new (std::nothrow) Label; diff --git a/native/cocos/2d/CCLabel.h b/native/cocos/2d/CCLabel.h index b04698a21e..44689e170b 100644 --- a/native/cocos/2d/CCLabel.h +++ b/native/cocos/2d/CCLabel.h @@ -322,6 +322,8 @@ public: */ int getStringLength(); + virtual void setColor(const Color3B& color); + /** * Sets the text color of Label. * @@ -784,4 +786,3 @@ private: NS_CC_END #endif /*__COCOS2D_CCLABEL_H */ -