BitmapData#hitTest, Different Behavior HTML5 vs Flash


I’ve been running into some issues with BitmapData and hitTest, in that it behaves differently on Html5 compared to Flash. It seems that the Html5 implementation only works if the “second” object has x and y greater than the x and y of the “first” object, whereas Flash version works with any coordinates.

I have attached a screenshot and also have a test project, if necessary, I can send it to whoever’s interested.

Please let me know if there’s any plan on adjusting this behavior.

Thank you.

Could you share some test code?

That would be really really helpful, thank you :slight_smile:

click the shapes to drag them around. the collision check is in Main.hx, line 32.

thank you for looking into this.

Thank you for the test code, I think I got it:

Please give this a try, and let me know if you have any troubles :wink:

works very well, thank you.

1 Like