I've wrote this but i want that the image fill all the screen. What i need to do?

Viewed 28

I've wrote this but i want that the image fill all the screen. What i need to do?

def load_image(name):
    img = pygame.image.load(name)
    return img

bg1 = load_image("Backgrounds/Back1.png")

screen.blit(bg1, (WIDTH/2, HEIGHT/2))

pygame.display.update()
1 Answers

Create a full screen display (see pygame.display.set_mode()):

screen = pygame.display.set_mode((WIDTH, HEIGHT), pygame.FULLSCREEN)

Use pygame.transform.smoothscale() to scale the scaled image to the size of the window

bg1 = load_image("Backgrounds/Back1.png")
bg_scaled = pygame.transform.smoothscale(bg1, screen.get_size())
screen.blit(bg_scaled, (0, 0))
Related