Skip to main content

draw_triangle()

Description#

Draws a triangle with 3 points (x1,y1), (x2,y2), (x3,y3): x1, y1, x2, y2, x3, y3.

Syntax#

draw_triangle(x1,y1,x2,y2,x3,y3)
draw_triangle(x1,y1,x2,y2,x3,y3,fill_in=True):

Parameters#

x1: the x coordinate of point 1
y1: the y coordinate of point 1
x2: the x coordinate of point 2
y2: the y coordinate of point 2
x3: the x coordinate of point 3
y3: the y coordinate of point 3
fill_in: Boolean that selects if the triangle will be filled in (white). Default to True.

Returns#

None

Example Code#
Python#
#Python code
from zumi.util.screen import Screen
screen=Screen()
screen.draw_triangle(0,10,20,50,50,0)