Act of creation
Or letting PyGame work for us.
To work with PyGame we must initialize it first, for this job PyGame have pygame module:
import pygame from pygame.locals import *
pygame.init
pygame.quit
To initialize every part of PyGame just call pygame.init() to quit your app pygame.quit()
pygame.get_error
pygame.error
To watch current error use pygame.get_error() but this string is also given to you when pygame.error exception rise. pygame.error is standard PyGame exception raised when any error accrue.
pygame.register_quit
If we need to clean up something before closing PyGame create for it a function and then call pygame.register_quit(written_function) and leave rest for PyGame. You can call it multiple times PyGame will call all of them in reversed order. (First will be the last)
page revision: 6, last edited: 30 Apr 2009 10:39





