Strange behavior of CCClippingNode on canvas render mode
Strange behavior of CCClippingNode on canvas render mode
@
setup:function () {
var target = cc.Sprite.create(s_pathBlock);
target.setAnchorPoint(0,0);
target.setScale(3);
this.*outerClipper = cc.ClippingNode.create;
this.*outerClipper.retain();
var transform = cc.AffineTransformMakeIdentity();
transform = cc.AffineTransformScale(transform, target.getScale(), target.getScale());
this.*outerClipper.setContentSize, transform));
this.*outerClipper.setAnchorPoint(0.5, 0.5);
this.*outerClipper.setPosition), 0.5));
this.*outerClipper.runAction(cc.RepeatForever.create(cc.RotateBy.create(1, 45)));
this.*outerClipper.setStencil;
var holesClipper = cc.ClippingNode.create;
holesClipper.setInverted;
holesClipper.setAlphaThreshold;
holesClipper.addChild;
this.*holes = cc.Node.create();
this.*holes.retain;
holesClipper.addChild;
this.*holesStencil = cc.Node.create();
this.*holesStencil.retain;
holesClipper.setStencil;
this.*outerClipper.addChild(holesClipper);
this.addChild(this._outerClipper);
this.setTouchEnabled(true);
}
@
- Target version set to Unplanned
Status: | New | |
---|---|---|
Start date: | 2013-12-25 | |
Priority: | Normal | |
Due date: | ||
Assignee: | - | |
% Done: | 0% |
|
Category: | - | |
Target version: | Unplanned |
A old version HoleDemo of ClippingNodeTest can trigger this bug:
With the ScrollViewDemo and SpriteTest before and after the HoleDemo test, if we switch the test scene from ScrollViewDemo to HoleDemo, the ScrollViewDemo’s rectangle stencil will still act as a stencil to the HoleDemo’s element.
In the other way, if we switch from SpriteTest to HoleDemo, the SpriteTest’s triangle stencil will act as a stencil to the HoleDemo’s element.
So the HoleDemo’s sprite is always rotating in a mask.
The current version of HoleDemo has been modified to avoid this problem, so this is the original setup function that can trigger the bug:
`setup:function () {
var target = cc.Sprite.create(s_pathBlock);
target.setAnchorPoint(0,0);
target.setScale(3);
`