-
Notifications
You must be signed in to change notification settings - Fork 3
Canvas line
mohayonao edited this page Aug 11, 2014
·
11 revisions
Draws a line to the canvas. To color a line, use the stroke()
function. A line cannot be filled, therefore the fill()
function will not affect the color of a line.
canvas.stroke(15)
.line(20, 20, 80, 80);
canvas.stroke([ 0, 15, 6 ])
.line(120, 50, 180, 50);
canvas.line(x1, y1, x2, y2);
-
x1: int
- x-coordinate of the first point
-
y1: int
- y-coordinate of the first point
-
x2: int
- x-coordinate of the second point
-
y2: int
- y-coordinate of the second point
Canvas: self for method chaining