clippingNode cut

Stencil = new new cc.Sprite the let (fileName); 

the let clippingNode new new cc.ClippingNode = ();
this.addChild (clippingNode);
clippingNode.setStencil (Stencil);
clippingNode.setAlphaThreshold (0); // not a crop that Jiamo it is a rectangular
clippingNode.setPosition (VisibleSize.width / 2, VisibleSize.height / 2);

the let display = new new cc.Sprite (fileName);
clippingNode.addChild (display);

the display displayed in accordance with the shape of stencil.

(Encountered for the Sprite mask, where the plus wipes. Shield effect is not displayed, in the case of displaying light sweep mask area. ClippingNode as a mask based approaches Stencil, then sweep the light as a child clippingNode, AlphaThreshold set to 0, then the wipes can only display the mask area.)

Guess you like

Origin www.cnblogs.com/guomengkai/p/11353665.html
cut