plane.getComponent(cc.Sprite).dstBlendFactor = cc.macro.ONE
这句,在h5有效果 再原生平台没有效果,是不是原生的有其他的接口?
plane.getComponent(cc.Sprite).dstBlendFactor = cc.macro.ONE
这句,在h5有效果 再原生平台没有效果,是不是原生的有其他的接口?
有报错?应该都能用的
没有报错,我是实现一个物体的受击效果。父节点和子节点纹理相同,改变混合模式,h5的有效果 模拟器和原生都没有,大佬可以弄个demo试一下。代码如下
cc.tween(this.node) .call(()=>{ this.planesp.getChildByName("plane_"+this.planeType).getComponent(cc.Sprite).dstBlendFactor = cc.macro.ONE; this.planesp.getChildByName("plane_"+this.planeType).opacity = 100; }) .delay(0.1) .call(()=>{ this.planesp.getChildByName("plane_"+this.planeType).getComponent(cc.Sprite).dstBlendFactor = cc.macro.ONE_MINUS_SRC_ALPHA; this.planesp.getChildByName("plane_"+this.planeType).opacity = 255; }) .start()
在原生测试过,可以正常使用,方便的话,给个 demo 看下
大佬 demo传了
是增加 这个文件的这段代码吗?
if (CC_JSB) {
RenderComponent.prototype.setVertsDirty.call(this);
}
添加上这段代码, 编译了引擎 没有起作用呢,是不是 还有其他步骤我没操作呢?