pygame-ce
pygame-ce copied to clipboard
Add line thickness in gfxdraw
Description
Add line thickness value in gfxdraw.aacircle and other gfxdraw shapes, just like in pygame.draw.
For now i am using this code for aacircle:
def draw_circle(surface, color, pos, radius, thickness):
if thickness != 1:
for num in range(1, thickness):
gfxdraw.aacircle(surface, int(pos[0]), int(pos[1]), int(radius)+num, color)
But it is not perfect: there can be seen background pixels between two lines, because gfxdraw accepts only int.
Tasks for closing
- [x] implement
pygame.draw.aacircle - [ ] deprecate
pygame.gfxdraw.aacircle
Please correct me if I'm wrong, but I think we have stopped supporting gfxdraw. Please confirm: @Starbuck5 @ankith26
I recommend using pygame.draw.circle() instead.
https://pyga.me/docs/ref/draw.html#pygame.draw.circle
The thing is we don't actively maintain gfxdraw, but because many people use it and it has some stuff that pygame.draw doesn't, gfxdraw isn't being removed anytime soon. The long term plan is to add all of gfxdraws features to draw and then we could deprecate/remove gfxdraw
@ankith26 Would adding a thickness parameter to aacircle and change its implementation to use pygame.draw instead be a good solution for this? Perhaps adding a deprecation message would also be a good idea.
Me personally, I don't want to be adding more changes to gfxdraw for above reasons. However I do agree that we should be adding deprecation warnings in gfxdraw, once we agree on a roadmap for it
I'm adding some tasks to the original message to close this issue when complete