Description:
Draws a sequence of connected straight lines on the specified surface
using a list of points. Each point is connected to the next in order,
forming a polyline. When closed is set to True,
the final point is automatically connected back to the first, creating
a closed outline shape.
from VertexEngine import VertexScreen
vs = VertexScreen()
points = [(60, 60), (180, 80), (240, 160), (120, 220)]
# Draw a closed shape
vs.Draw.lines(
surface,
(255, 255, 255),
closed=True,
points=points,
width=3
)
surface (Surface):
The surface on which the lines will be drawn, such as the main
display surface or an off-screen buffer.
color (tuple):
The RGB color of the lines, specified as (R, G, B).
closed (bool):
Determines whether the shape should be closed by connecting
the last point back to the first.
points (list of tuples):
A list of (x, y) coordinate pairs defining the
vertices of the polyline. At least two points are required.
width (int):
The thickness of the lines in pixels.
None — This method draws directly onto the surface and does not return a value.
VertexScreen.Draw.aalines().