如题
let graphics = this.node.getComponent(cc.Mask)["_graphics"];
graphics 为 null, 有什么办法获取 _graphics 吗
如题
let graphics = this.node.getComponent(cc.Mask)["_graphics"];
graphics 为 null, 有什么办法获取 _graphics 吗
1.x 继承的是 _RendererInSG
2.x 继承的是 RenderComponent
有点小麻烦.
let temp = this.node.getComponent(cc.Mask);
temp._clippingStencil.drawRect(cc.p(190, 190), cc.p(200, 200), cc.color(0, 255, 255, 255),79, cc.color(128, 128, 0, 255))
@jare 请问怎么有什么方法获取这个自定义挖空吗。
我现在是阻挡事件遮罩,除了节点本身挖空的区域可以穿透点击,自定义挖空的区域也想穿透点击。
在 v2.x 版本可以直接使用 _graphics 挖空实现自定义穿透点击,v1.x 则不可以,所以我在自定义挖空后,想获取对应的挖空区域,之后再去 mask 的 _hitTest 自行判断