Description:
Draws an anti-aliased (smooth) line on the specified surface between
start_pos and end_pos. Anti-aliasing reduces
jagged edges by blending the line with the background, resulting in
smoother and more visually appealing graphics. This method is ideal
for UI elements, outlines, guides, or any graphics that require clean
line rendering.
from VertexEngine import VertexScreen
vs = VertexScreen()
vs.Draw.aaline(
surface,
(255, 255, 255),
(50, 50),
(200, 150),
blend=True
)
surface (Surface):
The target surface on which the line will be drawn, such as the main
screen surface or an off-screen buffer.
color (tuple):
The RGB color of the line, specified as a tuple
(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).
blend (bool):
Enables or disables background blending for anti-aliasing.
Set to True for smoother lines, or False
for slightly faster rendering without blending.
None — This method draws directly onto the surface and does not return a value.