Hello all (especially
@GregBUG )
After
@atilim awesome example
http://www.giderosmobile.com/forum/discussion/comment/17263#Comment_17263I've tried to implement poll method for reusing the objects to improve performance in one of my projects.
And while it works awesome with Bitmap's etc, I'm was having problem implementing it in TNT Particle Engine.
So I wanted to share my solution for reusing it
At first I thought I'd only need to reuse emitter, and could simply change it's parents, but then I noticed, that particles are added to parent only when you assign particles to emitter (because they are created beforehand, right the needed amount of them) and you can't re-assign particle to emitter twice (to re-add particles to new parent).
So the easy work around is to create a dummy parent sprite, which you assign to emitter as parent group and then all you have to do is to start/stop emitter and re-add the dummy parent to where you need it. That's way you can easy reuse same emitter in poll (without any modifications to the TNT Engine)
Comments
just lost @atilim post. (yes i'm not very present last time in forum)
so now i study @atilim code, learn from it and reuse in TNT Patricles Engine 2
Likes: ar2rsawseen
www.tntengine.com