Get mouse position on Canvas
There are three types of get position of mouse.
- ScreenX/Y (Systemt Mouse Position)
- PageX/Y (Content Position ignore scroll)
- ClientX/Y (Browser Position)
Canvas.addEventListener('click',function(e){
var MousePosition_X = e.PageX;
var MousePosition_Y = e.PageY;
})
How to make canvas full screen?
dont forget body have margin and padding too. So you need to add this in <body>:
<body style="margin:0;padding:0">