[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] scaling the entire screen



This is very easy to do, thanks to the structure of pygame, blits and
surfaces.  Here is a simple (untested) example:

Old way:
resolution = [320,240]
screen = pygame.display.set_mode(resolution)

while 1:
   screen.blit(sprite,[5,5])
   pygame.display.flip()

New way:
resolution = [640,480]
real_res = [320,240]
_screen = pygame.display.set_mode(resolution)

while 1:
   screen.blit(sprite,[5,5])
   #other plits
   surf = pygame.transform.scale2x(screen)
   _screen.blit(surf,[0,0])
   pygame.display.flip()

And you have a nice doubly scaled screen.  It will probably be slower
than just writing the game for the higher resolution though.