Skip to content
Advertisement

Drawing Semi-Circles in Pygame

Is there a way to draw a semicircle in Pygame? Something like this:

semicircle

pygame.surface.set_clip() will not work for this – I need circles that look like pie slices as well, like this one:

pie slice

Advertisement

Answer

PyGame has no function to create filled arc/pie but you can use PIL/pillow to generate bitmap with pieslice and convert to PyGame image to display it.

JavaScript

Result:

enter image description here

GitHub: furas/python-examples/pygame/pillow-image-pieslice

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement