有没有一种方法可以使用python在pygame窗口上显示文本?
我需要显示一堆更新的实时信息,而不是为我需要的每个角色制作图像。
我可以将文本快速传送到屏幕上吗?
对可以在pygame中绘制文本:
# initialize font; must be called after 'pygame.init()' to avoid 'Font not Initialized' error myfont = pygame.font.SysFont("monospace", 15) # render text label = myfont.render("Some text!", 1, (255,255,0)) screen.blit(label, (100, 100))