Can I find out if the image is transparent in a certain position?

I am making a javascript game (for IE 10) that has a collection system. I want colide objects only when 2 visible parts are colide, I want to ignore the transparent parts of the images.

Is there a way to find out if the position from <img> is transparent or not?

+6
source share
2 answers

β€œBurn” the image to HTML5 canvas, then get the specific pixel from the canvas and check its Alpha ( http://falcon80.com/HTMLCanvas/PixelManipulation/getImageData.html ).

I think it would be easier if you only worked with an HTML5 canvas instead of navigating through DOM segments.

+4
source

Check the following message:

You can use the image with the old-fashioned <map> and <area>.

Hover over the opaque part of the image.

0
source

All Articles