pygame学习之打印文本
1 import pygame 2 from pygame.locals import * 3 white = 255, 255, 255 4 blue = 0, 0, 200 5 pygame.init() 6 screen = pygame.display.set_mode((600, 500)) 7 myfont = pygame.font.Font(None, 70) 8 textImage = myfont.render("HELLO WORLD", True, white) 9 while True: 10 for event in pygame.event.get(): 11 if event.type in (QUIT, KEYDOWN): 12 exit() 13 screen.fill(blue) 14 screen.blit(textImage, (100, 100)) 15 pygame.display.update()