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

Re: [pygame] scaling the entire screen



hello,

Note, that with pygame 1.8 the scale function can take a destination argument.

pygame.transform.scale(Surface, (width, height), DestSurface = None):
return Surface

dest_surf = pygame.transform.scale(s, (w,h), dest_surf)

This is way faster if you can reuse your destination surface - as it
avoids a memory allocation.

scale, scale2x, and the new smoothscale function all take destination
arguments now.

cheers,




On Thu, Mar 20, 2008 at 5:59 AM, Ian Mallett <geometrian@xxxxxxxxx> wrote:
> On 3/19/08, Patrick Mullen <saluk64007@xxxxxxxxx> wrote:
>  > The OP was asking for the option to let users choose the resolution,
>  >  so this isn't an option.  I would say to target the smallest
>  >  resolution, and at that level have no scaling.  The point of the low
>  >  resolution is for the fastest framerate.  For higher resolutions
>  >  either scale your images up beforehand, or scale them right after
>  >  pygame.image.load().  In drawing code, make sure you abstract the
>  >  resolution out of it.  You could scale all x,y values by same amount,
>  >  where the lowest resolution would have a scale of 1.0.  There are
>  >  probably other options as well.
>  OK.  My point was pretty much that there is a certain order which is
>  helpful in keeping the lowest resolution while eliminating artifacts.
>
> >  Or switch to opengl, where the problem vanishes :)
>  YES.
>  Ian
>