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;
_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()
{

View File

@ -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;