Kineticjs zasiahnutý región používam tak, ako je v: http://www.html5canvastutorials.com/kineticjs/html5-canvas-pixel-detection-with-kineticjs/
Môj obrázok má mŕtvicu:
var lion = new Kinetic.Image({
image: images.lion,
x: 280,
y: 30,
stroke: "red"
});
Obrázok nemá mŕtvicu, keď nepoužíval zasiahnuté oblasti, ale keď som použil nasledujúci, nevidel som žiadny zdvih.
// 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();
Ako môžem zviditeľniť mŕtvicu obrázka, keď použijem regióny zásahu?
odpovede:
0 pre odpoveď č. 1Ak chcete ohraničiť rámček, môžete nastaviť vlastnosť drawBorder na true:
lion.cache({
drawBorder: true
});
Na zdravie!