blurring background in pygame

Viewed 263

As a beginner in pygame, I am trying to build a game and want to blur the background as the game ends and show player his/her score and ask if he/she wants to play again.

I don't know how to blur the background in pygame. Can anyone help me?

Thank You.

2 Answers

Maybe try to insert an video that blur at the end unfortunately i dont think there is an blurring function.

import pygame

FPS = 60

pygame.init()
clock = pygame.time.Clock()
movie = pygame.movie.Movie('the bluring video.MPG')
screen = pygame.display.set_mode(movie.get_size())
movie_screen = pygame.Surface(movie.get_size()).convert()

movie.set_display(movie_screen)
movie.play()


playing = True
while playing:
    for event in pygame.event.get():
        if event.type == pygame.QUIT:
            movie.stop()
            playing = False

    screen.blit(movie_screen,(0,0))
    pygame.display.update()
    clock.tick(FPS)

pygame.quit()

if i find a way to blur the image ill post it. :)

Related