Vertex Docs

VertexScreen.Draw.polygon(surface, color, points, width)

Description: Draws a polygon on the specified surface by connecting a series of points in order. The final point is automatically connected back to the first, forming a closed shape. Depending on the width parameter, the polygon can be rendered as either an outlined shape or a filled shape.

Usage

from VertexEngine import VertexScreen

vs = VertexScreen()
points = [(100, 60), (200, 140), (160, 240), (40, 180)]

# Draw a filled polygon
vs.Draw.polygon(
    surface,
    (0, 200, 120),
    points=points,
    width=0
)

Parameters

Returns

None — This method draws directly onto the surface and does not return a value.

Notes