Equivalent to Flash BitmapData.hitTest () in HTML5 JavaScript

I would like to know if there are existing equivalent methods in JavaScript (for supported HTML5 browsers) that can evaluate hitTest bitmap-to-bitmap, such as Flash.

In addition, how can blur be achieved? Can existing DIV / SPAN tags be "drawn" (for example, the Flash BitmapData.draw () method) into a bitmap object, so can it be used for the "hitTest" target on the canvas?

I think I might have the wrong HTML jargon, but hopefully this makes some sense.

Are there any built-in methods for checking if bitmaps are related to each other when evaluating pixel levels?

Thank!

+3
source share
2 answers
  • No, there are no methods in HTML Canvas or Context to determine if two areas overlap. There are no tests for non-square areas of opaque pixels overlapping each other, no tests for transformed bounding rectangles, no tests even for overlapping bounding boxes on the axis. Any such impact testing should be done by you or a higher-level API to track individual bitmaps. The Canvas / Context container is an unsaved low-level API for pancakes and pixel drawing.

  • , HTML- ( drawImage() / ). , / . , , .

    • "" , , getImageData(), , , putImageData() .
+1

PlayMyCode Javascript , ActionScript hitTest.

+1

Source: https://habr.com/ru/post/1785035/


All Articles