The documentation says "For aapolygon, use aalines with the ‘closed’ parameter.", but pygame.draw.aalines doesn't let me specify the width (0 = filled), making it not fill the surface. This looks just terrible:

These circles look much better:

How can I do this?
I generate the surface using quadratic beziers, whose coordinates get appended to a list. Then I draw it onto the surface like this (In the image above I did this twice, once for the outer circle and once for the inner circle):
pygame.draw.polygon(self.image,fclr,self.points)
And the drawing code (shape.image is the same surface as self.image in the code above):
screen.fill((0,0,0))
screen.blit(shape.image,(100,100))
pygame.display.flip()
martineau's comment is on point: In order to draw antialiased filled shapes with pygame, use the module gfxdraw and draw one regular filled shape and one antialiased outline. From http://www.pygame.org/docs/ref/gfxdraw.html:
"To draw an anti aliased and filled shape, first use the aa* version of the function, and then use the filled version."
Note that you need to import gfxdraw explicitly, i.e. from pygame import gfxdraw.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With