diff --git a/cocos/2d/CCLabel.cpp b/cocos/2d/CCLabel.cpp index d1b6e10253..2c039da0c5 100644 --- a/cocos/2d/CCLabel.cpp +++ b/cocos/2d/CCLabel.cpp @@ -857,6 +857,13 @@ void Label::disableEffect(LabelEffect effect) updateShaderProgram(); } break; + case LabelEffect::ALL: + { + disableEffect(LabelEffect::SHADOW); + disableEffect(LabelEffect::GLOW); + disableEffect(LabelEffect::OUTLINE); + } + break; default: break; } diff --git a/cocos/2d/CCLabel.h b/cocos/2d/CCLabel.h index 88df82adb9..84ae9b315d 100644 --- a/cocos/2d/CCLabel.h +++ b/cocos/2d/CCLabel.h @@ -323,6 +323,7 @@ public: /** * Disable all effect to Label. + * @warning Please use disableEffect(LabelEffect::ALL) instead of this API. */ virtual void disableEffect(); diff --git a/cocos/base/ccTypes.h b/cocos/base/ccTypes.h index f821aec28a..c6a2e6d3b7 100644 --- a/cocos/base/ccTypes.h +++ b/cocos/base/ccTypes.h @@ -556,7 +556,8 @@ enum class LabelEffect { NORMAL, OUTLINE, SHADOW, - GLOW + GLOW, + ALL }; /** @struct Acceleration