Merge pull request #8588 from Dhilan007/v3-label8582

fixed issue#8582: opacity of label
This commit is contained in:
minggo 2014-10-09 15:50:44 +08:00
commit b8c5ce6db3
2 changed files with 12 additions and 6 deletions

View File

@ -1247,14 +1247,12 @@ bool Label::isOpacityModifyRGB() const
}
void Label::setOpacityModifyRGB(bool isOpacityModifyRGB)
{
if (isOpacityModifyRGB != _isOpacityModifyRGB)
{
_isOpacityModifyRGB = isOpacityModifyRGB;
for(const auto& child: _children) {
child->setOpacityModifyRGB(_isOpacityModifyRGB);
updateColor();
}
_reusedLetter->setOpacityModifyRGB(true);
}
void Label::updateDisplayedColor(const Color3B& parentColor)

View File

@ -577,7 +577,15 @@ void SpriteBatchNode::removeSpriteFromAtlas(Sprite *sprite)
void SpriteBatchNode::updateBlendFunc(void)
{
if (! _textureAtlas->getTexture()->hasPremultipliedAlpha())
{
_blendFunc = BlendFunc::ALPHA_NON_PREMULTIPLIED;
setOpacityModifyRGB(false);
}
else
{
_blendFunc = BlendFunc::ALPHA_PREMULTIPLIED;
setOpacityModifyRGB(true);
}
}
// CocosNodeTexture protocol