简体   繁体   English

为什么Kinetic.js中没有'positionChange'事件?

[英]Why is there no 'positionChange' event in Kinetic.js?

I am trying to do some AngularJS directive with KineticJS. 我试图用KineticJS做一些AngularJS指令。 I want a draggable joystick which is a circle in a kinetic canvas, i now want to add a event listener, which should work for touch and mouse. 我想要一个可拖动的操纵杆,它是动态画布中的一个圆圈,现在我想添加一个事件监听器,该监听器应该适用于触摸和鼠标。 I started trying touchmove but that did not work for mouse. 我开始尝试touchmove但不适用于鼠标。

So i took a look at the Object and i realized i can register xChange and i can do the same for yChange , but why is there no Listener for a positionChange ? 所以我看了一下Object,我意识到我可以注册xChange并且可以为yChange做同样的yChange ,但是为什么没有positionChange监听器呢? Of course i can register two handlers, but i fear this creates a ton of function calls. 当然,我可以注册两个处理程序,但是我担心这会创建大量的函数调用。

基本上我可以使用dragmove因为对象是可拖动的,并且此功能适用于触摸和鼠标

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM