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

Re: [pygame] Animated sprites



Does loading an sequence of animation strips from a single file take
up less memory than loading up each frame from its own file. I know
they take less time to load from the HDD, but I don't see how they
could take up less memory...

On 7/29/05, Jasper <jasper@xxxxxxxx> wrote:
> Dan wrote:
> 
> >Does anyone have a recommended way of making animated sprites?
> >
> >I read the source code to SolarWolf and saw the way Pete Shinners does
> >it, which is pretty much what you would expect: load a list of images
> >and blit them in sequence. (I also noticed his animstrip() function,
> >which cleverly cuts a single long image into multiple small ones. Good
> >thinking, Pete!)
> >
> >Since Pete is certainly an expert on pygame, I would guess that there's
> >no better way of doing it. But I thought I would ask if anyone has any
> >other suggestions.
> >
> >
> I use openGL to load animation "film strips" as textures. Animation is
> then just a matter of changing the texture sub-rect drawn, and
> animations draw just as fast as static images.  It does eat up a fair
> amount of texture memory though, which might be a problem if you had a
> huge amount of animation.
> 
> -Jasper
>