🔰path
A path is a sequence of one or more subpaths. A subpath is a sequence of two or more points connected by lines or curves.
.beginPath() - begin a new path.
.moveTo() - begin a new subpath.
.closePath() - add line to start of current subpath.
remember to call beginPath() when you want to begin another new path❗️
When you call fill(), any open shapes are closed automatically, so you don't have to call .closePath().
Before rect(x, y, width, height) is executed, the .moveTo() method is automatically called with the parameters (x,y).
main concepts
custom extension
related methods
examples
path / subpath
.beginPath() - begin new path.
.moveTo() - begin new subpath.
.closePath() - add line to start of current subpath.
drawing path:
fill / stroke styles:
line styles:
Last updated