transforming images in pygame

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()
5
задан codingJoe 8 March 2011 в 03:35
поделиться