sign in


Forgot your password?


Why sign up?
- One account for five websites!
- Free access to Premium Codes
- Acess to cool web tools
- Ask and answer questions
- Stay ahead of other web developers
- and MUCH MORE!

Feel The Power

Html Codes: Canvas- Select an Object by Mouse Click (Hit Detection)

One of the most important tools connecting users and the computers is mouse click. HTML5 Canvas, like other programming languages, has capability to detect whether a mouse click is in specified object (path) or not. But before that we must transform the mouse position based on the canvas element coordinates. Then a hit detector for each object can be created separately; and the object graphical style can change when it is selected. In the following example, click on one of the objects to see how HTML5 Canvas Mouse click detector works. If you click outside of all objects, all shapes styles returns to its default gray.

If you don't know how to use this code or need more information Click here!


You can leave comments once you sign in/up.


Online Users: 1
Total Online Users: 4
Recent Members: Hectortam,, KarianaJuida, asif raza, rankwebsite
Twitter LinkedIn Youtube

Download Link to us:


Please put this code in your page.