DragonBones / DragonBonesJS

DragonBones TypeScript / JavaScript Runtime
MIT License
746 stars 320 forks source link

egret 龙骨不能禁用点击事件! #110

Open gkjolin opened 5 years ago

gkjolin commented 5 years ago

armature.display.touchEnabled=false; armature.display.touchChildren=false; 问题描述 龙骨点击事件禁用后,依然阻止点击事件冒泡,无法点击背后的 错误代码 let armature:dragonBones.Armature=dragonBones.EgretFactory.factory.buildArmature(id); armature.display.touchEnabled=false; armature.display.touchChildren=false;

doneykoo commented 5 years ago

same here, wondering how to solve it

doneykoo commented 5 years ago

这边尝试成功方法: 把armature所在的父节点的 各个ui节点,都 touchEnabled = false, (注意是多个层级的各级,光1级父节点 touchEnabled = false、touchChildren=false没用) 可以避免龙骨部件把点击吃掉挡掉的问题,即表现出看起来好像点击事件不能禁用的问题。

相当于你可以想象为 内部的armature 导致各级父级ui(用于计算判断点击时)的大小被撑大了,即使ui逻辑上其实那几个父级的宽高都没那么大。