mirror of https://github.com/axmolengine/axmol.git
refactor TextBMFont setColor & setOpacity
This commit is contained in:
parent
d615de8299
commit
5ae97da030
|
@ -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()
|
||||
{
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue