0
我正在使用Kinetic.JS
庫開發HTML5應用程序。 我使用Kinetic.Image加載圖像(格式爲.PNG
),並使用像素檢測僅檢測圖像的非透明部分。問題是我無法正確拖動我的圖像,雖然我已將draggable
屬性設置爲true
並使用saveImageData
方法。 圖像被拖動之前(使用path
檢測)。任何解決方案傢伙 這是我的代碼:Kinetic.JS圖像使用像素檢測後無法拖動
var beeObj = new Image();
beeObj.onload = function(){
bee = new Kinetic.Image({ //bee is global variable
x: 325 - 45,
y: 145 - 83,
image: beeObj,
draggable: true
});
lineLayer.add(bee);
lineLayer.draw();
bee.saveImageData();
};
beeObj.src = directory + "smile_bee.png";
NB:Kinetic.JS版本:動能v3.10.4.js – 2012-07-28 17:59:03