gpt4 book ai didi

javascript - 禁用舞台光标上的画架鼠标事件

转载 作者:塔克拉玛干 更新时间:2023-11-02 21:27:55 25 4
gpt4 key购买 nike

在我的简单应用程序中,我需要隐藏原始光标 stage.cursor = 'none'; stage.enableMouseOver(),然后用我自己的图片替换它

然后我在 stagemousemove 事件上注册监听器:

myBitmap.x = stage.mouseX;
myBitmap.y = stage.mouseY;

此操作后,我将失去在其他舞台对象上监听鼠标事件的权限:

//nothing happen on mouse over
someBitmap.on('mouseover', function() { console.log(1) });

是否有任何可能的解决方案,期望每次在舞台鼠标事件中对我的对象进行 hitTest 时检查?

最佳答案

通过在我的 css 规则中设置 cursor: none 并从 js 中删除 stage.cursor = 'none' 来修复。谢谢@Andew例如。

关于javascript - 禁用舞台光标上的画架鼠标事件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38915451/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com