I created a function that is generating random objects in the canvas
area and wanted to clear the area after the function was finished.
Is there any way to do this?
I created a function that is generating random objects in the canvas
area and wanted to clear the area after the function was finished.
Is there any way to do this?
context.clearRect(A, B, C, D);
A: point on the X axis where cleaning will start.
B: point on the Y axis where the cleaning will begin.
C: X-axis boundary to where it will be cleaned.
D: Limit on the Y axis to where it will be cleaned.
context.clearRect(0, 0, canvas.width, canvas.height);
Note: this clears the form u from the point X = 0 and Y = 0 until the end of its canvas
% which is canvas.width
% canvas.height
and