【发布时间】:2019-10-21 13:02:48
【问题描述】:
我在 Pygame 中有一个程序,它允许我显示列表 list 中的元素。每 3 秒,它更新并显示来自list 的下一个元素。
我的问题是元素在屏幕上重叠,但我想在每次 3 秒后更新它。我已经用过:
pygame.display.update()
但它不起作用。
list = ["x", "y", "z"]
if time > 3 and i < len(list):
font = pygame.font.SysFont("comicsansms", 72)
text2 = font.render(str(list[i]), True, (0, 128, 0))
screen.blit(text2,
(430 - text2.get_width() // 1, 220 - text2.get_height() // 2))
pygame.display.update()
pygame.display.flip()
clock.tick(30)
i = i + 1
【问题讨论】:
标签: python list pygame display