Skip to main content

draw_polygon()

Description#

Draws lines between points in a given list [(x1,y1),...,(xn,yn)] to form a shape.

Syntax#

draw_polygon(points_list)
draw_polygon(points_list,fill_in = True):

Parameters#

points_list: A list [x1,y1,x2,y2,....xn,yn] with at least 3 points
fill_in: Boolean that selects if the polygon 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()
points = [(30,50),(90,10),(20,10),(5,20)]
screen.draw_polygon(points)