1 """<title>an example of text usage</title>"""
3 from pygame.locals import *
5 # the following line is not needed if pgu is installed
6 import sys; sys.path.insert(0, "..")
12 screen = pygame.display.set_mode((640,480),SWSURFACE)
18 font = pygame.font.SysFont("default", 24)
21 text.write(screen,font,(0,0),bg,"Hello World!")
22 text.writec(screen,font,bg,"Centered Text")
23 text.writepre(screen,font,pygame.Rect(160,48,320,100),fg,"""This is some
26 text.writewrap(screen,font,pygame.Rect(160,268,320,100),fg,"""This is some text that will wrap automatically. This is some text that will wrap automatically.
28 This is some text that will wrap automatically. This is some text that will wrap automatically.""")
35 for e in pygame.event.get():
36 if e.type is QUIT: _quit = 1