var clip = new cc.LayerColor(cc.color(0, 0, 0), size.width, size.height)
//var clip = new cc.Sprite(res.mask)
clip.setAnchorPoint(0, 0)
clip.setScale(1)
clip.setPosition(0, 0)
var mask = new cc.ClippingNode(clip)
mask.setAnchorPoint(0, 0)
this.addChild(mask, 12)
this.sprs = this.sprites(gameData.layer09_data)
this.sprs.forEach(function(item){
mask.addChild(item, item.data.zindex)
})
不规则图形裁剪后有黑色可以设置下面这个就可以去掉
layer.setBlendFunc(cc.SRC_ALPHA, cc.ONE)
网友评论