mirror of https://github.com/axmolengine/axmol.git
Merge pull request #8588 from Dhilan007/v3-label8582
fixed issue#8582: opacity of label
This commit is contained in:
commit
b8c5ce6db3
|
@ -1248,13 +1248,11 @@ bool Label::isOpacityModifyRGB() const
|
||||||
|
|
||||||
void Label::setOpacityModifyRGB(bool isOpacityModifyRGB)
|
void Label::setOpacityModifyRGB(bool isOpacityModifyRGB)
|
||||||
{
|
{
|
||||||
_isOpacityModifyRGB = isOpacityModifyRGB;
|
if (isOpacityModifyRGB != _isOpacityModifyRGB)
|
||||||
|
{
|
||||||
for(const auto& child: _children) {
|
_isOpacityModifyRGB = isOpacityModifyRGB;
|
||||||
child->setOpacityModifyRGB(_isOpacityModifyRGB);
|
updateColor();
|
||||||
}
|
}
|
||||||
|
|
||||||
_reusedLetter->setOpacityModifyRGB(true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Label::updateDisplayedColor(const Color3B& parentColor)
|
void Label::updateDisplayedColor(const Color3B& parentColor)
|
||||||
|
|
|
@ -577,7 +577,15 @@ void SpriteBatchNode::removeSpriteFromAtlas(Sprite *sprite)
|
||||||
void SpriteBatchNode::updateBlendFunc(void)
|
void SpriteBatchNode::updateBlendFunc(void)
|
||||||
{
|
{
|
||||||
if (! _textureAtlas->getTexture()->hasPremultipliedAlpha())
|
if (! _textureAtlas->getTexture()->hasPremultipliedAlpha())
|
||||||
|
{
|
||||||
_blendFunc = BlendFunc::ALPHA_NON_PREMULTIPLIED;
|
_blendFunc = BlendFunc::ALPHA_NON_PREMULTIPLIED;
|
||||||
|
setOpacityModifyRGB(false);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_blendFunc = BlendFunc::ALPHA_PREMULTIPLIED;
|
||||||
|
setOpacityModifyRGB(true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// CocosNodeTexture protocol
|
// CocosNodeTexture protocol
|
||||||
|
|
Loading…
Reference in New Issue