Learn Before
Code
Drawing Arcs in Pygame
The draw.arc() function allows you to draw an arc based on an ellipse. The function takes in the surface, color, rectangle that will bound the ellipse the arc is based on, two floats for the start and stop angles in radians, and optional width. The width is used to determine line thickness or if the arc should be filled. When the width is 0, the arc will be filled. If it's greater than 0, it will determine the thickness of the line. If it's less than 0, nothing will be drawn.
displaySurface = pygame.display.set_mode((1920, 1080)) displayColor = (0, 0, 0) rect = pygame.Rect(30, 30, 60, 60) start_angle = 25 stop_angle = 45 width = 0 pygame.draw.arc(displaySurface, displayColor, rect, start_angle, stop_angle, width)
0
1
Updated 2021-06-21
Tags
Python Programming Language
Data Science