override setCameraMask

This commit is contained in:
yangxiao 2015-03-16 17:11:17 +08:00
parent f56d8c4784
commit 5b26ba3c68
4 changed files with 13 additions and 1 deletions

View File

@ -316,6 +316,14 @@ void ClippingNode::visit(Renderer *renderer, const Mat4 &parentTransform, uint32
director->popMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_MODELVIEW);
}
void ClippingNode::setCameraMask(unsigned short mask, bool applyChildren)
{
Node::setCameraMask(mask, applyChildren);
if (_stencil)
_stencil->setCameraMask(mask, applyChildren);
}
Node* ClippingNode::getStencil() const
{
return _stencil;

View File

@ -104,6 +104,8 @@ public:
virtual void onExit() override;
virtual void visit(Renderer *renderer, const Mat4 &parentTransform, uint32_t parentFlags) override;
virtual void setCameraMask(unsigned short mask, bool applyChildren = true) override;
CC_CONSTRUCTOR_ACCESS:
ClippingNode();

View File

@ -912,6 +912,8 @@ void Label::draw(Renderer *renderer, const Mat4 &transform, uint32_t flags)
void Label::setCameraMask(unsigned short mask, bool applyChildren)
{
SpriteBatchNode::setCameraMask(mask, applyChildren);
if (_textSprite)
{
_textSprite->setCameraMask(mask, applyChildren);

View File

@ -266,7 +266,7 @@ public:
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 setCameraMask(unsigned short mask, bool applyChildren) override;
virtual void setCameraMask(unsigned short mask, bool applyChildren = true) override;
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,