diff --git a/cocos/ui/UITextBMFont.cpp b/cocos/ui/UITextBMFont.cpp index 4b36afbfda..4e4c7f34a7 100644 --- a/cocos/ui/UITextBMFont.cpp +++ b/cocos/ui/UITextBMFont.cpp @@ -87,7 +87,9 @@ void TextBMFont::setFntFile(const std::string& fileName) } _fntFileName = fileName; _labelBMFontRenderer->setBMFontFilePath(fileName); - updateRGBAToRenderer(_labelBMFontRenderer); + + _labelBMFontRenderer->setColor(this->getColor()); + _labelBMFontRenderer->setOpacity(this->getOpacity()); _fntFileHasInit = true; setString(_stringValue); } @@ -165,21 +167,6 @@ std::string TextBMFont::getDescription() const { return "TextBMFont"; } - -void TextBMFont::updateTextureColor() -{ - updateColorToRenderer(_labelBMFontRenderer); -} - -void TextBMFont::updateTextureOpacity() -{ - updateOpacityToRenderer(_labelBMFontRenderer); -} - -void TextBMFont::updateTextureRGBA() -{ - updateRGBAToRenderer(_labelBMFontRenderer); -} Widget* TextBMFont::createCloneInstance() { diff --git a/cocos/ui/UITextBMFont.h b/cocos/ui/UITextBMFont.h index 246bcee2b1..707f42382c 100644 --- a/cocos/ui/UITextBMFont.h +++ b/cocos/ui/UITextBMFont.h @@ -89,9 +89,7 @@ public: protected: virtual void initRenderer() override; virtual void onSizeChanged() override; - virtual void updateTextureColor() override; - virtual void updateTextureOpacity() override; - virtual void updateTextureRGBA() override; + void labelBMFontScaleChangedWithSize(); virtual Widget* createCloneInstance() override; virtual void copySpecialProperties(Widget* model) override;