import sys, pygame, time size = width, height = 700,700 fontColor = (0,0,255) class walk: '''This is a game about war. Just like war 3.''' def __init__(self): '''Init the screen. Get param and init the screen''' #print ('this is init funnction') def initMainGraph(self): print ('ここでメン画面を初期化') def outputChar(self, screen, imgRect): oc = pygame.font.SysFont('Arial', 36) str = 'Let/'s Start the Game' wid = 100 hei = 300 for i in str: surf = oc.render(i,0,fontColor) rec = surf.get_rect() wid += 20 rec.topleft = (wid, hei) screen.blit(surf,rec) pygame.display.flip() time.sleep(0.25) def slow(self, screen, imgRect): print ('slow show') def runGame(): pygame.init() screen = pygame.display.set_mode(size) bgimg = pygame.image.load('world.png').convert_alpha()#load bgImage imgRect = bgimg.get_rect() #get the Area of the Image screen.blit(bgimg,imgRect) pygame.display.flip() luxs = walk() #create a object luxs.outputChar(screen, imgRect) time.sleep(3) while 1: for event in pygame.event.get(): if event.type == pygame.QUIT: sys.exit(0) runGame() 初学者,做了一个小例子,显示背景图和文本