2013-05-06 42 views
1
this.prototype.bounding = new Kinetic.Shape(function() { 
    var context = this.getContext(); 
    context.beginPath(); 
    context.arc(0, 0, radius, 0, 2 * Math.PI, false); 
    context.fillStyle = color; 
    context.fill(); 
},"PerspectiveCar"); 
this.prototype.bounding.vx = 0; 
this.prototype.bounding.vy = 0; 
this.prototype.bounding.x = positionX; 
this.prototype.bounding.y = positionY;  
this.prototype.bounding.on("mousedown", function() { 
     alert('Hi'); 
}); 

嗨, 我正在使用KineticJS 3.6版本。 鼠標事件在這裏不起作用。 我不知道原因。 你能幫助我嗎?Kinetic JS 3.6中的鼠標事件

謝謝維傑

回答

0

它也不適用於「點擊」?

this.prototype.bounding.on("click", function() { 
     alert('Hi'); 
});