Skip to content

Commit 71e7488

Browse files
committed
fix gfxdraw
1 parent 2876446 commit 71e7488

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

src/test_gfxdraw.py

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
#!/usr/bin/env python
2+
3+
"""Proof of concept gfxdraw example"""
4+
5+
import asyncio
6+
import pygame
7+
import pygame.gfxdraw
8+
import pygame.draw
9+
10+
async def main():
11+
pygame.init()
12+
screen = pygame.display.set_mode((500,500))
13+
screen.fill((255, 0, 0))
14+
s = pygame.Surface(screen.get_size(), pygame.SRCALPHA, 32)
15+
pygame.draw.line(s, (0,0,0), (250, 250), (250+200,250))
16+
17+
width = 1
18+
for a_radius in range(width):
19+
radius = 200
20+
#pygame.gfxdraw.aacircle(s, 250, 250, radius-a_radius, (0, 0, 0))
21+
pygame.draw.circle(s, (0, 0, 0), (250, 250), radius-a_radius, width=1)
22+
23+
screen.blit(s, (0, 0))
24+
pygame.display.flip()
25+
run = True
26+
while run:
27+
for event in pygame.event.get():
28+
if event.type == pygame.QUIT:
29+
run = False
30+
elif event.type == pygame.KEYDOWN:
31+
if event.key == pygame.K_ESCAPE or event.unicode == 'q':
32+
run = False
33+
break
34+
pygame.display.flip()
35+
await asyncio.sleep(0)
36+
pygame.quit()
37+
38+
if __name__ == '__main__':
39+
asyncio.run(main())

0 commit comments

Comments
 (0)