Vertex Docs

VertexScreen.Draw.line(surface, color, start_pos, end_pos, width)

Description: Draws a straight line on the specified surface between start_pos and end_pos. This method is ideal for rendering simple shapes, separators, grids, debug visuals, or basic UI elements. The appearance of the line can be customized using the width parameter.

Usage

from VertexEngine import VertexScreen

vs = VertexScreen()

# Draw a thick diagonal line
vs.Draw.line(
    surface,
    (255, 255, 255),
    start_pos=(50, 50),
    end_pos=(300, 200),
    width=5
)

Parameters

Returns

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

Notes