- 1
When using canvas in html when you use the function ctx.fillRect(x,y,w,h); where is the x and y located in the created rectangle
X and Y position of canvas rectangle
2 Respostas
+ 6
x, y starts at the top left corner of the canvas
(0,0)
-------------------------->
|
|
|
|
|
V
ctx.fillRect(40,20,10,20);
can't guarantee accuracy >:p
-------------------------->
| (40,20)
| |||||| ^ h
| |||||| v
| <w>
|
V
+ 1
x and y are located inside your canvas.