The line
shape draws a line between two points on the canvas. You can optionally specify the color to be used while drawling the line.
To understand how to declare and draw a shape please refer, to this document.
To declare and draw a LINE shape named TheBigRedLine
between the points (100, 100)
and (200, 200)
in color Red we write the following statement.
shape TheBigRedLine(line):
.point1 = (100, 100)
.point2 = (200, 200)
.thickness = 2
.color = RED
endshape
Parameter | Description | Possible values | Default | Required? |
---|---|---|---|---|
point1 | starting point of the line | point | - | Yes |
point2 | ending point of the line | point | - | Yes |
thickness | the thickness of the line | 1 to 100 | 2 | No |
color | the color of the line | builtin colors | BLACK | No |
Notice any errors or typos? Please let us know or feel free to edit line.md and issue a pull request.
Follow us on twitter @RevineLang
Built by Arpit Bhayani