Search code examples
javascripthtmlkineticjs

dragging image with transparent background


I use kineticjs example from this page http://www.html5canvastutorials.com/labs/html5-canvas-animals-on-the-beach-game-with-kineticjs/. Everything works fine- i can move, drag image (kinetic.image) etc. The problem is when i press cursor on transparent area of image, dragging doesn't work then. What to do to make image draggable irrespective of that i press cursor on drawed region or transparent background of this image?


Solution

  • Try removing lines 121 and 122. The page is loading a script that is not being shown that changes the dragable region to the non-transparent parts. For more info look here

    Lines to remove:

    animal.cache();
    animal.drawHitFromCache();