~ubuntu-branches/ubuntu/maverick/pygame/maverick

« back to all changes in this revision

Viewing changes to examples/aacircle.py

  • Committer: Bazaar Package Importer
  • Author(s): Sebastien Bacher
  • Date: 2010-01-14 17:02:11 UTC
  • mfrom: (1.3.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20100114170211-21eop2ja7mr9vdcr
Tags: 1.9.1release-0ubuntu1
* New upstream version (lp: #433304)
* debian/control:
  - build-depends on libportmidi-dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/env python
 
2
 
 
3
"""Proof of concept gfxdraw example"""
 
4
 
 
5
import pygame
 
6
import pygame.gfxdraw
 
7
 
 
8
def main():
 
9
    pygame.init()
 
10
    screen = pygame.display.set_mode((500,500))
 
11
    screen.fill((255, 0, 0))
 
12
    s = pygame.Surface(screen.get_size(), pygame.SRCALPHA, 32)
 
13
    pygame.gfxdraw.aacircle(s, 250, 250, 200, (0, 0, 0))
 
14
    screen.blit(s, (0, 0))
 
15
    pygame.display.flip()
 
16
    try:
 
17
        while 1:
 
18
            event = pygame.event.wait()
 
19
            if event.type == pygame.QUIT:
 
20
                break
 
21
            if event.type == pygame.KEYDOWN:
 
22
                if event.key == pygame.K_ESCAPE or event.unicode == 'q':
 
23
                    break
 
24
            pygame.display.flip()
 
25
    finally:
 
26
        pygame.quit()
 
27
 
 
28
if __name__ == '__main__':
 
29
    main()