Description:
Draws an arc along the edge of an imaginary ellipse defined by the given
rectangle. The arc starts at start_angle and ends at
stop_angle, measured in radians. This method is useful for
rendering circular UI elements such as progress indicators, gauges,
loading spinners, or decorative outlines.
from VertexEngine import VertexScreen
import math
vs = VertexScreen()
rect = (100, 100, 200, 200)
vs.Draw.arc(
surface,
(255, 0, 0),
rect,
start_angle=0,
stop_angle=math.pi,
width=4
)
surface (Surface):
The surface on which the arc will be drawn, such as the main display
surface or an off-screen buffer.
color (tuple):
The RGB color of the arc, specified as (R, G, B).
rect (tuple):
A rectangle (x, y, width, height) that defines the bounding
box of the ellipse from which the arc is drawn.
start_angle (float):
The starting angle of the arc in radians. An angle of 0
points to the right, and angles increase clockwise.
stop_angle (float):
The ending angle of the arc in radians.
width (int):
The thickness of the arc line in pixels. Use higher values for
bolder arcs.
None — This method draws directly onto the surface and does not return a value.
math.radians() to convert degrees to radians if needed.width to 0 may result in a filled shape, depending on implementation.