Hello, I keep on trying to develop my 2D RPG engine, and I face another slowdown problem.
The map of the game is made of tiles (32 x 32 px) and some of them (say, around 30 among 500) are animated. I tried to represent each by a sprite, whose image would be an Animation. But that is too slow. Since most of these tiles are actually the same, I thought that, rather than updating the image attribute of each 30 sprites, it would be more clever to make those prite.image point to the same texture, and updating this texture (by blitting the proper "image" regularly). I assumed fact that copying something to a texture would be quite fast, especially if the "something" is too a texture. Unfortunately, I can't figure out how to blit a TextureRegion in a texture. blit_to_texture keeps on raising the same error : pyglet.image.ImageException: Cannot blit <TextureRegion 32x32> to a texture. So my two questions : 1) Is this idea (modify texture rather than sprite) sufficient to improve performances ? 2) how to blit a texture on another ? Thanks in advance, -- 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.
