Answer the question
In order to leave comments, you need to log in
Why is there an error in fillRect()?
Good afternoon! Can't draw using Canvas. I am getting Uncaught TypeError: ctx.flllRect is not a function at HTMLCanvasElement.canvas.onmousedown
My code:
var canvas = document.getElementById('c1');
var ctx = canvas.getContext('2d');
canvas.onmousemove = function(event){
canvas.onmousedown = function(event){
var x = event.offsetX;
var y = event.offsetY;
console.log(x);
console.log(y);
ctx.flllRect(x-5,y-5,5,5);
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question