7
Reply

Object Type at Coordinate on Canvas

David Kay

David Kay

Jul 12 2011 6:07 AM
1.6k
How can I determine what type of element is at a given coordinate on a canvas?

I am making tetris and have polygons dropping down the canvas. I wish to check position (50,50) for example, and see if that point contains a polygon or not.

Basically I want to do collision detection, and can't find an easy way to do it since my polygons are not all rectangular.

Answers (7)