I'm trying to resize an image in pygame. I want my background image to fill the entire screen. I'd like to setup the entire screen based on the new (stretched) dimensions of the background. The following isn't working and I'm trying to figure out why.
Suggestions?
background = pygame.image.load("data/stars.bmp")
pygame.transform.scale(background, (1200,800)) #or some size x,y here.
bgRect = background.get_rect()
size = width, height = bgRect.width, bgRect.height
screen = pygame.display.set_mode(size)
screen.blit(background, bgRect)
pygame.display.flip()
#pygame.transform.scale(background, (1200,800)) #or some size x,y here.
background = pygame.transform.scale(background, (1200,800))
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With