Skip to main content

draw_line()

Description#

Draws a line between points (x1,y1) and (x2,y2).

Syntax#

draw_line(x1, y1, x2, y2)
draw_line(x1, y1, x2, y2, thickness=1,fill_in=True)

Parameters#

x1: x coordinate of the starting point
y1: y coordinate of the starting point
x2: x coordinate of the ending point
y2: y coordinate of the ending point
thickness: pixel width of the line
fill_in: Boolean that selects if the line will be filled in (white). Default to True.

Returns#

None

Example Code#
Python#
#Python code
from zumi.util.screen import Screen
import time
screen=Screen()
screen.draw_line(0,0,40,40,fill_in=True)
screen.draw_line(40,0,0,40,thickness=10,fill_in=True)