From 7735a75651b84f81189e308f9c12fcc829b00289 Mon Sep 17 00:00:00 2001 From: Ricardo Quesada Date: Wed, 20 Jan 2016 17:59:13 -0800 Subject: [PATCH 1/3] adds JS tests for RichText --- .../script/ccui/jsb_ccui_create_apis.js | 2 +- cocos/ui/UIRichText.cpp | 4 +- .../GUITest/UIRichTextTest/UIRichTextTest.js | 541 +++++++++++++++++- tests/js-tests/src/GUITest/UISceneManager.js | 68 ++- 4 files changed, 610 insertions(+), 5 deletions(-) diff --git a/cocos/scripting/js-bindings/script/ccui/jsb_ccui_create_apis.js b/cocos/scripting/js-bindings/script/ccui/jsb_ccui_create_apis.js index c14f90fdad..7cb5811da1 100644 --- a/cocos/scripting/js-bindings/script/ccui/jsb_ccui_create_apis.js +++ b/cocos/scripting/js-bindings/script/ccui/jsb_ccui_create_apis.js @@ -125,7 +125,7 @@ ccui.TextField.prototype._ctor = function(placeholder, fontName, fontSize){ }; ccui.RichElementText.prototype._ctor = function(tag, color, opacity, text, fontName, fontSize){ - fontSize !== undefined && this.init(tag, color, opacity, text, fontName, fontSize); + fontSize !== undefined && this.init(tag, color, opacity, text, fontName, fontSize, 0, ""); }; ccui.RichElementImage.prototype._ctor = function(tag, color, opacity, filePath){ diff --git a/cocos/ui/UIRichText.cpp b/cocos/ui/UIRichText.cpp index e3708c6364..d9c3237539 100644 --- a/cocos/ui/UIRichText.cpp +++ b/cocos/ui/UIRichText.cpp @@ -813,9 +813,9 @@ void RichText::handleImageRenderer(const std::string& filePath, const Color3B &c imageRenderer->setScaleY(height / currentSize.height); imageRenderer->setContentSize(Size(currentSize.width * imageRenderer->getScaleX(), currentSize.height * imageRenderer->getScaleY())); - } - handleCustomRenderer(imageRenderer); + handleCustomRenderer(imageRenderer); + } } void RichText::handleCustomRenderer(cocos2d::Node *renderer) diff --git a/tests/js-tests/src/GUITest/UIRichTextTest/UIRichTextTest.js b/tests/js-tests/src/GUITest/UIRichTextTest/UIRichTextTest.js index 580d73f6c5..31041e2d04 100644 --- a/tests/js-tests/src/GUITest/UIRichTextTest/UIRichTextTest.js +++ b/tests/js-tests/src/GUITest/UIRichTextTest/UIRichTextTest.js @@ -88,4 +88,543 @@ var UIRichTextTest = UIMainLayer.extend({ } } } -}); \ No newline at end of file +}); + +// +// UIRichTextXMLBasic +// +var UIRichTextXMLBasic = UIMainLayer.extend({ + _richText:null, + init: function () { + if (this._super()) { + //init text + this._topDisplayLabel.setString(""); + this._bottomDisplayLabel.setString("RichText"); + + var widgetSize = this._widget.getContentSize(); + var button = new ccui.Button(); + button.setTouchEnabled(true); + button.loadTextures("ccs-res/cocosui/animationbuttonnormal.png", "ccs-res/cocosui/animationbuttonpressed.png", ""); + button.setTitleText("switch"); + button.setPosition(cc.p(widgetSize.width / 2, widgetSize.height / 2 + button.getContentSize().height * 2.5)); + button.addTouchEventListener(this.touchEvent,this); + this._mainNode.addChild(button); + + // RichText + var richText = new ccui.RichText(); + richText.initWithXML("This is just a simple text. no xml tags here. testing the basics. testing word-wrapping. testing, testing, testing"); + + richText.ignoreContentAdaptWithSize(false); + richText.width = 120; + richText.height = 100; + + richText.x = widgetSize.width / 2; + richText.y = widgetSize.height / 2; + + this._mainNode.addChild(richText); + this._richText = richText; + return true; + } + return false; + }, + touchEvent: function (sender, type) { + if (type == ccui.Widget.TOUCH_ENDED) { + if (this._richText.isIgnoreContentAdaptWithSize()) { + this._richText.ignoreContentAdaptWithSize(false); + this._richText.setContentSize(cc.size(120, 100)); + } else { + this._richText.ignoreContentAdaptWithSize(true); + } + } + } +}); + +// +// UIRichTextXMLSmallBig +// +var UIRichTextXMLSmallBig = UIMainLayer.extend({ + _richText:null, + init: function () { + if (this._super()) { + //init text + this._topDisplayLabel.setString(""); + this._bottomDisplayLabel.setString("RichText"); + + var widgetSize = this._widget.getContentSize(); + var button = new ccui.Button(); + button.setTouchEnabled(true); + button.loadTextures("ccs-res/cocosui/animationbuttonnormal.png", "ccs-res/cocosui/animationbuttonpressed.png", ""); + button.setTitleText("switch"); + button.setPosition(cc.p(widgetSize.width / 2, widgetSize.height / 2 + button.getContentSize().height * 2.5)); + button.addTouchEventListener(this.touchEvent,this); + this._mainNode.addChild(button); + + // RichText + var richText = new ccui.RichText(); + richText.initWithXML("Regular size.smaller size.bigger.normal.bigger.normal."); + + richText.ignoreContentAdaptWithSize(false); + richText.width = 120; + richText.height = 100; + + richText.x = widgetSize.width / 2; + richText.y = widgetSize.height / 2; + + this._mainNode.addChild(richText); + this._richText = richText; + return true; + } + return false; + }, + touchEvent: function (sender, type) { + if (type == ccui.Widget.TOUCH_ENDED) { + if (this._richText.isIgnoreContentAdaptWithSize()) { + this._richText.ignoreContentAdaptWithSize(false); + this._richText.setContentSize(cc.size(120, 100)); + } else { + this._richText.ignoreContentAdaptWithSize(true); + } + } + } +}); + +// +// UIRichTextXMLColor +// +var UIRichTextXMLColor = UIMainLayer.extend({ + _richText:null, + init: function () { + if (this._super()) { + //init text + this._topDisplayLabel.setString(""); + this._bottomDisplayLabel.setString("RichText"); + + var widgetSize = this._widget.getContentSize(); + var button = new ccui.Button(); + button.setTouchEnabled(true); + button.loadTextures("ccs-res/cocosui/animationbuttonnormal.png", "ccs-res/cocosui/animationbuttonpressed.png", ""); + button.setTitleText("switch"); + button.setPosition(cc.p(widgetSize.width / 2, widgetSize.height / 2 + button.getContentSize().height * 2.5)); + button.addTouchEventListener(this.touchEvent,this); + this._mainNode.addChild(button); + + // RichText + var richText = new ccui.RichText(); + richText.initWithXML("Defaul color.red.greenred again.default again"); + + richText.ignoreContentAdaptWithSize(false); + richText.width = 120; + richText.height = 100; + + richText.x = widgetSize.width / 2; + richText.y = widgetSize.height / 2; + + this._mainNode.addChild(richText); + this._richText = richText; + return true; + } + return false; + }, + touchEvent: function (sender, type) { + if (type == ccui.Widget.TOUCH_ENDED) { + if (this._richText.isIgnoreContentAdaptWithSize()) { + this._richText.ignoreContentAdaptWithSize(false); + this._richText.setContentSize(cc.size(120, 100)); + } else { + this._richText.ignoreContentAdaptWithSize(true); + } + } + } +}); + +// +// UIRichTextXMLSUIB +// +var UIRichTextXMLSUIB = UIMainLayer.extend({ + _richText:null, + init: function () { + if (this._super()) { + //init text + this._topDisplayLabel.setString(""); + this._bottomDisplayLabel.setString("RichText"); + + var widgetSize = this._widget.getContentSize(); + var button = new ccui.Button(); + button.setTouchEnabled(true); + button.loadTextures("ccs-res/cocosui/animationbuttonnormal.png", "ccs-res/cocosui/animationbuttonpressed.png", ""); + button.setTitleText("switch"); + button.setPosition(cc.p(widgetSize.width / 2, widgetSize.height / 2 + button.getContentSize().height * 2.5)); + button.addTouchEventListener(this.touchEvent,this); + this._mainNode.addChild(button); + + // RichText + var richText = new ccui.RichText(); + richText.initWithXML("system font: underlineitalicsboldstrike-through"); + + richText.ignoreContentAdaptWithSize(false); + richText.width = 120; + richText.height = 100; + + richText.x = widgetSize.width / 2; + richText.y = widgetSize.height / 2; + + this._mainNode.addChild(richText); + this._richText = richText; + return true; + } + return false; + }, + touchEvent: function (sender, type) { + if (type == ccui.Widget.TOUCH_ENDED) { + if (this._richText.isIgnoreContentAdaptWithSize()) { + this._richText.ignoreContentAdaptWithSize(false); + this._richText.setContentSize(cc.size(120, 100)); + } else { + this._richText.ignoreContentAdaptWithSize(true); + } + } + } +}); + +// +// UIRichTextXMLSUIB2 +// +var UIRichTextXMLSUIB2 = UIMainLayer.extend({ + _richText:null, + init: function () { + if (this._super()) { + //init text + this._topDisplayLabel.setString(""); + this._bottomDisplayLabel.setString("RichText"); + + var widgetSize = this._widget.getContentSize(); + var button = new ccui.Button(); + button.setTouchEnabled(true); + button.loadTextures("ccs-res/cocosui/animationbuttonnormal.png", "ccs-res/cocosui/animationbuttonpressed.png", ""); + button.setTitleText("switch"); + button.setPosition(cc.p(widgetSize.width / 2, widgetSize.height / 2 + button.getContentSize().height * 2.5)); + button.addTouchEventListener(this.touchEvent,this); + this._mainNode.addChild(button); + + // RichText + var richText = new ccui.RichText(); + richText.initWithXML("ttf font: underlineitalicsboldstrike-through"); + + richText.ignoreContentAdaptWithSize(false); + richText.width = 120; + richText.height = 100; + + richText.x = widgetSize.width / 2; + richText.y = widgetSize.height / 2; + + this._mainNode.addChild(richText); + this._richText = richText; + return true; + } + return false; + }, + touchEvent: function (sender, type) { + if (type == ccui.Widget.TOUCH_ENDED) { + if (this._richText.isIgnoreContentAdaptWithSize()) { + this._richText.ignoreContentAdaptWithSize(false); + this._richText.setContentSize(cc.size(120, 100)); + } else { + this._richText.ignoreContentAdaptWithSize(true); + } + } + } +}); + +// +// UIRichTextXMLSUIB3 +// +var UIRichTextXMLSUIB3 = UIMainLayer.extend({ + _richText:null, + init: function () { + if (this._super()) { + //init text + this._topDisplayLabel.setString(""); + this._bottomDisplayLabel.setString("RichText"); + + var widgetSize = this._widget.getContentSize(); + var button = new ccui.Button(); + button.setTouchEnabled(true); + button.loadTextures("ccs-res/cocosui/animationbuttonnormal.png", "ccs-res/cocosui/animationbuttonpressed.png", ""); + button.setTitleText("switch"); + button.setPosition(cc.p(widgetSize.width / 2, widgetSize.height / 2 + button.getContentSize().height * 2.5)); + button.addTouchEventListener(this.touchEvent,this); + this._mainNode.addChild(button); + + // RichText + var richText = new ccui.RichText(); + richText.initWithXML("ttf font: italics and underlinebold and strike-through"); + + richText.ignoreContentAdaptWithSize(false); + richText.width = 120; + richText.height = 100; + + richText.x = widgetSize.width / 2; + richText.y = widgetSize.height / 2; + + this._mainNode.addChild(richText); + this._richText = richText; + return true; + } + return false; + }, + touchEvent: function (sender, type) { + if (type == ccui.Widget.TOUCH_ENDED) { + if (this._richText.isIgnoreContentAdaptWithSize()) { + this._richText.ignoreContentAdaptWithSize(false); + this._richText.setContentSize(cc.size(120, 100)); + } else { + this._richText.ignoreContentAdaptWithSize(true); + } + } + } +}); + +// +// UIRichTextXMLImg +// +var UIRichTextXMLImg = UIMainLayer.extend({ + _richText:null, + init: function () { + if (this._super()) { + //init text + this._topDisplayLabel.setString(""); + this._bottomDisplayLabel.setString("RichText"); + + var widgetSize = this._widget.getContentSize(); + var button = new ccui.Button(); + button.setTouchEnabled(true); + button.loadTextures("ccs-res/cocosui/animationbuttonnormal.png", "ccs-res/cocosui/animationbuttonpressed.png", ""); + button.setTitleText("switch"); + button.setPosition(cc.p(widgetSize.width / 2, widgetSize.height / 2 + button.getContentSize().height * 2.5)); + button.addTouchEventListener(this.touchEvent,this); + this._mainNode.addChild(button); + + // RichText + var richText = new ccui.RichText(); + richText.initWithXML("you should see an image here: and this is text again. and this is the same image, but bigger: and here goes text again"); + + richText.ignoreContentAdaptWithSize(false); + richText.width = 120; + richText.height = 100; + + richText.x = widgetSize.width / 2; + richText.y = widgetSize.height / 2; + + this._mainNode.addChild(richText); + this._richText = richText; + return true; + } + return false; + }, + touchEvent: function (sender, type) { + if (type == ccui.Widget.TOUCH_ENDED) { + if (this._richText.isIgnoreContentAdaptWithSize()) { + this._richText.ignoreContentAdaptWithSize(false); + this._richText.setContentSize(cc.size(120, 100)); + } else { + this._richText.ignoreContentAdaptWithSize(true); + } + } + } +}); + +// +// UIRichTextXMLUrl +// +var UIRichTextXMLUrl = UIMainLayer.extend({ + _richText:null, + init: function () { + if (this._super()) { + //init text + this._topDisplayLabel.setString(""); + this._bottomDisplayLabel.setString("RichText"); + + var widgetSize = this._widget.getContentSize(); + var button = new ccui.Button(); + button.setTouchEnabled(true); + button.loadTextures("ccs-res/cocosui/animationbuttonnormal.png", "ccs-res/cocosui/animationbuttonpressed.png", ""); + button.setTitleText("switch"); + button.setPosition(cc.p(widgetSize.width / 2, widgetSize.height / 2 + button.getContentSize().height * 2.5)); + button.addTouchEventListener(this.touchEvent,this); + this._mainNode.addChild(button); + + // RichText + var richText = new ccui.RichText(); + richText.initWithXML("And this link will redirect you to google: click me"); + + richText.ignoreContentAdaptWithSize(false); + richText.width = 120; + richText.height = 100; + + richText.x = widgetSize.width / 2; + richText.y = widgetSize.height / 2; + + this._mainNode.addChild(richText); + this._richText = richText; + return true; + } + return false; + }, + touchEvent: function (sender, type) { + if (type == ccui.Widget.TOUCH_ENDED) { + if (this._richText.isIgnoreContentAdaptWithSize()) { + this._richText.ignoreContentAdaptWithSize(false); + this._richText.setContentSize(cc.size(120, 100)); + } else { + this._richText.ignoreContentAdaptWithSize(true); + } + } + } +}); + +// +// UIRichTextXMLFace +// +var UIRichTextXMLFace = UIMainLayer.extend({ + _richText:null, + init: function () { + if (this._super()) { + //init text + this._topDisplayLabel.setString(""); + this._bottomDisplayLabel.setString("RichText"); + + var widgetSize = this._widget.getContentSize(); + var button = new ccui.Button(); + button.setTouchEnabled(true); + button.loadTextures("ccs-res/cocosui/animationbuttonnormal.png", "ccs-res/cocosui/animationbuttonpressed.png", ""); + button.setTitleText("switch"); + button.setPosition(cc.p(widgetSize.width / 2, widgetSize.height / 2 + button.getContentSize().height * 2.5)); + button.addTouchEventListener(this.touchEvent,this); + this._mainNode.addChild(button); + + // RichText + var richText = new ccui.RichText(); + richText.initWithXML("Marker Felt 20.Arial 20.Thonburi 24 blue"); + + richText.ignoreContentAdaptWithSize(false); + richText.width = 120; + richText.height = 100; + + richText.x = widgetSize.width / 2; + richText.y = widgetSize.height / 2; + + this._mainNode.addChild(richText); + this._richText = richText; + return true; + } + return false; + }, + touchEvent: function (sender, type) { + if (type == ccui.Widget.TOUCH_ENDED) { + if (this._richText.isIgnoreContentAdaptWithSize()) { + this._richText.ignoreContentAdaptWithSize(false); + this._richText.setContentSize(cc.size(120, 100)); + } else { + this._richText.ignoreContentAdaptWithSize(true); + } + } + } +}); + +// +// UIRichTextXMLBR +// +var UIRichTextXMLBR = UIMainLayer.extend({ + _richText:null, + init: function () { + if (this._super()) { + //init text + this._topDisplayLabel.setString(""); + this._bottomDisplayLabel.setString("RichText"); + + var widgetSize = this._widget.getContentSize(); + var button = new ccui.Button(); + button.setTouchEnabled(true); + button.loadTextures("ccs-res/cocosui/animationbuttonnormal.png", "ccs-res/cocosui/animationbuttonpressed.png", ""); + button.setTitleText("switch"); + button.setPosition(cc.p(widgetSize.width / 2, widgetSize.height / 2 + button.getContentSize().height * 2.5)); + button.addTouchEventListener(this.touchEvent,this); + this._mainNode.addChild(button); + + // RichText + var richText = new ccui.RichText(); + richText.initWithXML("this is one line.
this should be in another line.
and this is another line"); + + richText.ignoreContentAdaptWithSize(false); + richText.width = 120; + richText.height = 100; + + richText.x = widgetSize.width / 2; + richText.y = widgetSize.height / 2; + + this._mainNode.addChild(richText); + this._richText = richText; + return true; + } + return false; + }, + touchEvent: function (sender, type) { + if (type == ccui.Widget.TOUCH_ENDED) { + if (this._richText.isIgnoreContentAdaptWithSize()) { + this._richText.ignoreContentAdaptWithSize(false); + this._richText.setContentSize(cc.size(120, 100)); + } else { + this._richText.ignoreContentAdaptWithSize(true); + } + } + } +}); + +// +// UIRichTextXMLInvalid +// +var UIRichTextXMLInvalid = UIMainLayer.extend({ + _richText:null, + init: function () { + if (this._super()) { + //init text + this._topDisplayLabel.setString(""); + this._bottomDisplayLabel.setString("RichText"); + + var widgetSize = this._widget.getContentSize(); + var button = new ccui.Button(); + button.setTouchEnabled(true); + button.loadTextures("ccs-res/cocosui/animationbuttonnormal.png", "ccs-res/cocosui/animationbuttonpressed.png", ""); + button.setTitleText("switch"); + button.setPosition(cc.p(widgetSize.width / 2, widgetSize.height / 2 + button.getContentSize().height * 2.5)); + button.addTouchEventListener(this.touchEvent,this); + this._mainNode.addChild(button); + + // RichText + var richText = new ccui.RichText(); + richText.initWithXML("this is an invalid xml. no closing tag"); + + richText.ignoreContentAdaptWithSize(false); + richText.width = 120; + richText.height = 100; + + richText.x = widgetSize.width / 2; + richText.y = widgetSize.height / 2; + + this._mainNode.addChild(richText); + this._richText = richText; + return true; + } + return false; + }, + touchEvent: function (sender, type) { + if (type == ccui.Widget.TOUCH_ENDED) { + if (this._richText.isIgnoreContentAdaptWithSize()) { + this._richText.ignoreContentAdaptWithSize(false); + this._richText.setContentSize(cc.size(120, 100)); + } else { + this._richText.ignoreContentAdaptWithSize(true); + } + } + } +}); diff --git a/tests/js-tests/src/GUITest/UISceneManager.js b/tests/js-tests/src/GUITest/UISceneManager.js index 1aa84a7a3e..72587d9a6d 100644 --- a/tests/js-tests/src/GUITest/UISceneManager.js +++ b/tests/js-tests/src/GUITest/UISceneManager.js @@ -551,6 +551,72 @@ func: function () { return new UIRichTextTest(); } + }, + { + title: "UIRichTextXMLBasic", + func: function () { + return new UIRichTextXMLBasic(); + } + }, + { + title: "UIRichTextXMLSmallBig", + func: function () { + return new UIRichTextXMLSmallBig(); + } + }, + { + title: "UIRichTextXMLColor", + func: function () { + return new UIRichTextXMLColor(); + } + }, + { + title: "UIRichTextXMLSUIB", + func: function () { + return new UIRichTextXMLSUIB(); + } + }, + { + title: "UIRichTextXMLSUIB2", + func: function () { + return new UIRichTextXMLSUIB2(); + } + }, + { + title: "UIRichTextXMLSUIB3", + func: function () { + return new UIRichTextXMLSUIB3(); + } + }, + { + title: "UIRichTextXMLImg", + func: function () { + return new UIRichTextXMLImg(); + } + }, + { + title: "UIRichTextXMLUrl", + func: function () { + return new UIRichTextXMLUrl(); + } + }, + { + title: "UIRichTextXMLFace", + func: function () { + return new UIRichTextXMLFace(); + } + }, + { + title: "UIRichTextXMLBR", + func: function () { + return new UIRichTextXMLBR(); + } + }, + { + title: "UIRichTextXMLInvalid", + func: function () { + return new UIRichTextXMLInvalid(); + } } ] }; @@ -715,4 +781,4 @@ this._currentUISceneId = 0; }; -})(window); \ No newline at end of file +})(window); From 60d273e31b471b790957bc3349c1f0324f2b4783 Mon Sep 17 00:00:00 2001 From: Ricardo Quesada Date: Wed, 20 Jan 2016 18:41:59 -0800 Subject: [PATCH 2/3] underline and strikethrough working ok on system fonts --- cocos/2d/CCLabel.cpp | 36 ++++++++++++++++++++++++++++-------- 1 file changed, 28 insertions(+), 8 deletions(-) diff --git a/cocos/2d/CCLabel.cpp b/cocos/2d/CCLabel.cpp index 533fe174b8..cb509bd56c 100644 --- a/cocos/2d/CCLabel.cpp +++ b/cocos/2d/CCLabel.cpp @@ -1382,19 +1382,36 @@ void Label::updateContent() if (_underlineNode) { - const float charheight = (_textDesiredHeight / _numberOfLines); - _underlineNode->clear(); - _underlineNode->setLineWidth(charheight/6); - for (int i=0; i<_numberOfLines; ++i) + if (_numberOfLines) { - float offsety = 0; + const float charheight = (_textDesiredHeight / _numberOfLines); + _underlineNode->setLineWidth(charheight/6); + + // atlas font + for (int i=0; i<_numberOfLines; ++i) + { + float offsety = 0; + if (_strikethroughEnabled) + offsety += charheight / 2; + // FIXME: Might not work with different vertical alignments + float y = (_numberOfLines - i - 1) * charheight + offsety; + _underlineNode->drawLine(Vec2(_linesOffsetX[i],y), Vec2(_linesWidth[i] + _linesOffsetX[i],y), _textColorF); + } + } + else if (_textSprite) + { + // system font + float y = 0; + const auto spriteSize = _textSprite->getContentSize(); + _underlineNode->setLineWidth(spriteSize.height/6); + if (_strikethroughEnabled) - offsety += charheight / 2; + // FIXME: system fonts don't report the height of the font correctly. only the size of the texture, which is POT + y += spriteSize.height / 2; // FIXME: Might not work with different vertical alignments - float y = (_numberOfLines - i - 1) * charheight + offsety; - _underlineNode->drawLine(Vec2(_linesOffsetX[i],y), Vec2(_linesWidth[i] + _linesOffsetX[i],y), _textColorF); + _underlineNode->drawLine(Vec2(0,y), Vec2(spriteSize.width,y), Color4F(_textSprite->getDisplayedColor())); } } @@ -1857,6 +1874,9 @@ void Label::updateDisplayedColor(const Color3B& parentColor) { _shadowNode->updateDisplayedColor(_displayedColor); } + + if (_underlineNode) + _contentDirty = true; } for (auto&& it : _letters) From 4c114327817984a4d339de70c6b118a6b2bcdb45 Mon Sep 17 00:00:00 2001 From: Ricardo Quesada Date: Wed, 20 Jan 2016 19:08:31 -0800 Subject: [PATCH 3/3] fixed bold --- cocos/2d/CCLabel.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/cocos/2d/CCLabel.cpp b/cocos/2d/CCLabel.cpp index cb509bd56c..b9d3db10b5 100644 --- a/cocos/2d/CCLabel.cpp +++ b/cocos/2d/CCLabel.cpp @@ -1184,6 +1184,7 @@ void Label::disableEffect(LabelEffect effect) { _shadowEnabled = false; CC_SAFE_RELEASE_NULL(_shadowNode); + updateShaderProgram(); } break; case cocos2d::LabelEffect::GLOW: