screen = pygame.display.set_mode([800,600])
pygame.display.set_caption("example")
background = pygame.Surface(screen.get_size())
background.fill(white)
clock = pygame.time.Clock()
background_image = pygame.image.load("example.jpg").convert()
background_position=[30,30]
done = False
while done == False:
clock.tick(10)
for event in pygame.event.get():
if event.type == pygame.QUIT:
done= True
screen.blit(background_image,background_position)
pygame.display.flip()
pygame.quit()
所以我一直在尝试在pygame中加载图像,可能很简单,我有点让它工作但图像实际上并没有出现在主表面上,当我关闭窗口时它只出现2秒。我是否忘记在某处进行 blit 或更新?谢谢!