我在以下链接(How to load and play a video in pygame)
中按照问题所做的操作但实际发生的是一个较小的窗口弹出黑屏,视频无法播放。
视频位于.mpg
def game_credits():
Creds = pygame.movie.Movie("C:\Users\itzrb_000\Documents\gameCreds.mpg")
screen = pygame.display.set_mode(Creds.get_size())
Creds_screen = pygame.Surface(Creds.get_size()).convert()
Creds.set_display(Creds_screen)
Creds.play
playing = True
while playing:
for event in pygame.event.get():
if event.type == pygame.QUIT:
pygame.quit()
quit()
screen.blit(Creds_screen, (0, 0))
pygame.display.update()
clock.tick(50)
感谢您阅读