我有一个标题画面循环,它采用标题画面并逐渐淡出。它直接从我的另一个程序中复制,在其中它就像一个魅力。但它在这里不起作用。它正确延迟,但屏幕上的图像不会改变。有什么想法吗?
titlescreen.set_alpha(255)
title_alpha_value = 255
screen.blit(titlescreen, (0, 0))
pygame.display.flip()
while not past_title:
for event in pygame.event.get():
if event.type == pygame.QUIT:
sys.exit('Thanks for playing!')
elif event.type == pygame.KEYDOWN or event.type == pygame.MOUSEBUTTONDOWN:
while titlescreen.get_alpha() >= 1:
title_alpha_value -= 5
screen.fill(128, 128, 128)
titlescreen.set_alpha(title_alpha_value)
screen.blit(titlescreen, (0, 0))
pygame.display.flip()
pygame.time.delay(1)
past_title = True
break