Learn Before
  • Drawing Shapes in Pygame

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

4 years ago

Tags

Python Programming Language

Data Science

Related
  • Drawing Rectangles in Pygame

  • Drawing Polygons in Pygame

  • Drawing Circles in Pygame

  • Drawing Ellipses in PyGame

  • Drawing Arcs in Pygame

  • Drawing Lines in Pygame