refactor TextBMFont setColor & setOpacity

This commit is contained in:
andyque 2014-06-06 16:09:59 +08:00
parent d615de8299
commit 5ae97da030
2 changed files with 4 additions and 19 deletions

View File

@ -87,7 +87,9 @@ void TextBMFont::setFntFile(const std::string& fileName)
} }
_fntFileName = fileName; _fntFileName = fileName;
_labelBMFontRenderer->setBMFontFilePath(fileName); _labelBMFontRenderer->setBMFontFilePath(fileName);
updateRGBAToRenderer(_labelBMFontRenderer);
_labelBMFontRenderer->setColor(this->getColor());
_labelBMFontRenderer->setOpacity(this->getOpacity());
_fntFileHasInit = true; _fntFileHasInit = true;
setString(_stringValue); setString(_stringValue);
} }
@ -166,21 +168,6 @@ std::string TextBMFont::getDescription() const
return "TextBMFont"; return "TextBMFont";
} }
void TextBMFont::updateTextureColor()
{
updateColorToRenderer(_labelBMFontRenderer);
}
void TextBMFont::updateTextureOpacity()
{
updateOpacityToRenderer(_labelBMFontRenderer);
}
void TextBMFont::updateTextureRGBA()
{
updateRGBAToRenderer(_labelBMFontRenderer);
}
Widget* TextBMFont::createCloneInstance() Widget* TextBMFont::createCloneInstance()
{ {
return TextBMFont::create(); return TextBMFont::create();

View File

@ -89,9 +89,7 @@ public:
protected: protected:
virtual void initRenderer() override; virtual void initRenderer() override;
virtual void onSizeChanged() override; virtual void onSizeChanged() override;
virtual void updateTextureColor() override;
virtual void updateTextureOpacity() override;
virtual void updateTextureRGBA() override;
void labelBMFontScaleChangedWithSize(); void labelBMFontScaleChangedWithSize();
virtual Widget* createCloneInstance() override; virtual Widget* createCloneInstance() override;
virtual void copySpecialProperties(Widget* model) override; virtual void copySpecialProperties(Widget* model) override;