I am trying to resize an image in pygame. I want my background image to fill the entire screen. I would like to adjust the whole screen based on the new (stretched) background sizes. The following do not work, and I am trying to understand why.
Suggestions?
background = pygame.image.load("data/stars.bmp")
pygame.transform.scale(background, (1200,800))
bgRect = background.get_rect()
size = width, height = bgRect.width, bgRect.height
screen = pygame.display.set_mode(size)
screen.blit(background, bgRect)
pygame.display.flip()
source
share