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.
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
)
surface (Surface):
The surface on which the line will be drawn, such as the main
display surface or an off-screen rendering buffer.
color (tuple):
The RGB color of the line, specified as (R, G, B).
start_pos (tuple):
The starting coordinates of the line in the format
(x, y).
end_pos (tuple):
The ending coordinates of the line in the format
(x, y).
width (int):
The thickness of the line in pixels. Higher values produce
thicker lines.
None — This method draws directly onto the surface and does not return a value.
1 are the most performant.VertexScreen.Draw.aaline().