Basically, I have a code which shows where the user clicks on the canvas:
canvas.onclick = function(e){
ctx.fillRect(e.clientX,e.clientY,10,10);
}
It works perfectly well if I include this in the code:
canvas.width = canvas.clientWidth;
canvas.height = canvas.clientHeight;
But I want the width and height of the canvas to be 200! Like this:
canvas.width = 200;
canvas.height = 200;
Whenever I try this, the clicks go all wrong! How can I have a width of 200 on my fullscreen canvas without resizing it or the window???