fix camra mask for label does not work

This commit is contained in:
yangxiao 2015-03-16 15:31:29 +08:00
parent 878590946f
commit f56d8c4784
2 changed files with 14 additions and 0 deletions

View File

@ -910,6 +910,18 @@ void Label::draw(Renderer *renderer, const Mat4 &transform, uint32_t flags)
} }
} }
void Label::setCameraMask(unsigned short mask, bool applyChildren)
{
if (_textSprite)
{
_textSprite->setCameraMask(mask, applyChildren);
}
if (_shadowNode)
{
_shadowNode->setCameraMask(mask, applyChildren);
}
}
void Label::createSpriteWithFontDefinition() void Label::createSpriteWithFontDefinition()
{ {
_currentLabelType = LabelType::STRING_TEXTURE; _currentLabelType = LabelType::STRING_TEXTURE;

View File

@ -266,6 +266,8 @@ public:
virtual void visit(Renderer *renderer, const Mat4 &parentTransform, uint32_t parentFlags) override; virtual void visit(Renderer *renderer, const Mat4 &parentTransform, uint32_t parentFlags) override;
virtual void draw(Renderer *renderer, const Mat4 &transform, uint32_t flags) override; virtual void draw(Renderer *renderer, const Mat4 &transform, uint32_t flags) override;
virtual void setCameraMask(unsigned short mask, bool applyChildren) override;
CC_DEPRECATED_ATTRIBUTE static Label* create(const std::string& text, const std::string& font, float fontSize, CC_DEPRECATED_ATTRIBUTE static Label* create(const std::string& text, const std::string& font, float fontSize,
const Size& dimensions = Size::ZERO, TextHAlignment hAlignment = TextHAlignment::LEFT, const Size& dimensions = Size::ZERO, TextHAlignment hAlignment = TextHAlignment::LEFT,
TextVAlignment vAlignment = TextVAlignment::TOP); TextVAlignment vAlignment = TextVAlignment::TOP);