【发布时间】:2014-04-13 22:57:18
【问题描述】:
我使用 Kineticjs 命中区域,位于:http://www.html5canvastutorials.com/kineticjs/html5-canvas-pixel-detection-with-kineticjs/
我的图片有中风:
var lion = new Kinetic.Image({
image: images.lion,
x: 280,
y: 30,
stroke: "red"
});
图像在不使用命中区域时有笔触,但当我使用以下区域时,我没有看到任何笔触。
// in order to ignore transparent pixels in an image when detecting
// events, we first need to cache the image
lion.cache();
// next, we need to redraw the hit graph using the cached image
lion.drawHitFromCache();
// finally, we need to redraw the layer hit graph
layer.drawHit();
如何在使用点击区域时让图像的笔触可见?
【问题讨论】:
标签: javascript html canvas kineticjs