Description:
Draws a sequence of connected anti-aliased (smooth) lines on the specified
surface using a list of points. Each point is connected to the next in order.
When closed is set to True, the final point is
automatically connected back to the first, forming a closed shape.
Anti-aliasing blends the lines with the background to reduce jagged edges,
resulting in smoother and more visually appealing outlines.
from VertexEngine import VertexScreen
vs = VertexScreen()
points = [(50, 50), (150, 80), (200, 150), (100, 200)]
vs.Draw.aalines(
surface,
(0, 255, 0),
closed=True,
points=points,
blend=True
)
surface (Surface):
The surface on which the lines will be drawn, such as the main screen
or an off-screen rendering surface.
color (tuple):
The RGB color of the lines, specified as (R, G, B).
closed (bool):
Determines whether the sequence of lines should form a closed shape.
If True, the last point connects back to the first.
points (list of tuples):
A list of (x, y) coordinate pairs defining the vertices
of the line path. At least two points are required.
blend (bool):
Enables or disables background blending for anti-aliasing.
Set to True for smoother lines, or False
for slightly faster rendering.
None — This method draws directly onto the surface and does not return a value.