> Well, ignore my advice :) > > You could be using an image.Animation and define the frames as > image.AnimationFrame. My suggestion of using a texture atlas is OK though. > > Then create a Sprite using that Animation as image and render all your > sprites using a batch. > > Sometimes I tend to reinvent the wheel instead of using what Pyglet > provides. Sorry! > > Regards, > > Juan > > That's basically what I was doing (TextureBin containing all animation stances, and attaching Animation to Sprite.image.
It didn't work : only the first image of the animation was played. I think it comes from the fact that I don't use pyglet.app.run, but instead wrote my own main loop routine (for several reasons, one of these being that I read in a previous thread on this group that all the event handling that pyglet.app.run makes can slow down). So the 'event' that makes Animation being updated mustn't occur. So I wrote my own animation handling (but I've checked the sources : it's quite the same code than pyglet.image.Animation.or the same that you posted) But this is slow (I timed it : I'm at 16 fps for 40 animated sprites). Those animated sprites share the same texture. So I wondered if, instead of changing all 40 sprite.image, it wouldn't be faster to modify directly the image (the texture) they share. But I'm open to any other idea :) -- > jjm's home: http://www.usebox.net/jjm/ > blackshell: http://blackshell.usebox.net/ > -- You received this message because you are subscribed to the Google Groups "pyglet-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/pyglet-users. For more options, visit https://groups.google.com/groups/opt_out.
