Line

Line objects are created using the following functions.  Lines are drawn between a starting point (x1, y1) and an ending point (x2, y2).

Function Description
Line(x1, y1, x2, y2) Creates a line from point x1, y1, to point x2, y2.
Line(x1, y1, x2, y2, color, thickness) Creates a line from point x1, y1, to point x2, y2,. Additional optional parameters include color (e.g. Color.BLACK (default), Color.ORANGE or Color(255, 0, 255), using specific RGB values), and thickness (default is 1 (pixel)).

Once a Line has been created, it may be added to a Display specifying where to place its leftmost point.

Finally, you may use the following functions:

Function Description
line.getX() Returns the x coordinate (in pixels).
line.getY() Returns the y coordinate (in pixels).
line.setX(x) Sets the x coordinate (in pixels).
line.setY(width) Sets the y coordinate (in pixels).
line.getPosition() Returns the position as an (x, y) tuple.
line.setPosition(x, y) Sets the position to x, y.
line.encloses(other) Returns True if line encloses other (may be any Widget or Graphics object).
line.intersects(other) Returns True if line intersects other (may be any Widget or Graphics object).