pixijs / particle-emitter

A particle system for PixiJS
http://pixijs.io/particle-emitter/docs
MIT License
786 stars 124 forks source link

Prewarm? #118

Closed digilocker closed 4 years ago

digilocker commented 4 years ago

Hi, sorry if this is already a feature but can't see anything for it..

Is it possible to prewarm the emitters in anyway. I've been trialing a fog simulation, nothing fancy. It looks fine when running, but starting up it looks a bit strange until the particles settle into their looping pattern.

In the end this maybe masked anyway with a menu or something but would be great if there was a possible alternative?

Thanks in advance!

andrewstart commented 4 years ago

So you just want the emitter to look like it has been running for a while when it is first seen? You'll need to call myEmitter.update(<seconds to have been running for>); - You may see a quick hitch in your framerate as many new particles are instantiated, but the emitter should interpolate all the particles that it creates into the appropriate positions (and just skip any that would be spawned and immediately killed, so passing in a number larger than your particle lifetime shouldn't cause any problems).

digilocker commented 4 years ago

@andrewstart sorry for the delay in getting back to you. Had been working on other parts of the project so was awaiting to get back to this. Just to confirm that solution worked perfectly, many thanks! :)

andrewstart commented 4 years ago

You and another person asked in the span of a week, so it sounds like I should document that clearly!