for my case either due to the number of sprites is small (about 50 sprites with physics body) or my poor programming skills, i only manage to get about 10% improvement which is like 20fps (old) vs 23fps (new)
While(E) wrote:Love the idea of this class, but is there an efficient way to use it with AnimatedSprites? The real question is can you individually manipulate the animation (or current tile index) of each of them, such as if you were to initialize the sprite with a clone of the TiledTextureRegion. I haven't tested it yet, but I'm assuming that if it would work with the TiledTextureRegion which I doubt at the moment, then it would act like it doesn't clone but simply assigns and therefore all of the Sprites will be manipulated at the same time?
- Now that's alot of assumptions, which will probably make an ass of me.
While(E) wrote:- Found that this class doesn't support TiledTextureRegions, my bad! Would've been nice though, because AnimatedSprites can be very similar as well, and therefore very redundant.
While(E) wrote:- Have since formulated my own AnimatedSpriteBatch class using TiledTextureRegion, haven't fully tested yet but seems to work just fine. Kudos again Nic
Nicolas Gramlich wrote:yes, the same approach could be applied to primitives, pretty much with the same code, excluding where TextureRegions are used.
Nicolas Gramlich wrote:Note have a look a the SpriteGroup class, which might be already doing what you need!
tomjr wrote:Nicolas Gramlich wrote:Note have a look a the SpriteGroup class, which might be already doing what you need!
In my game, Sprites will be added to SpriteGroup at runtime (after SpriteGroup is attached to Scene). That causes NullPointerException on onDrawSpriteBatch() because SpriteGroup has surely no children yet. Is it a bug or I just suck?
Anyway, I had another (very similar) SpriteGroup just to make it work in my case.
Users browsing this forum: No registered users and 4 guests