tguerin / newton

An Easy To Use Particle Emitter
https://newton.7omtech.fr
MIT License
21 stars 7 forks source link

Stop animation progressively #26

Open angelorodem opened 2 weeks ago

angelorodem commented 2 weeks ago

Is it possible to control the emission "quantity"?

i mean, imagine the Rain effect, is it possible to slow down the emission and remove the effect? i have been trying to remove the effect but all particles just disappear without any smoothing, it would be nice to slow the effects will there is nothing in the screen before being able to remove.

angelorodem commented 2 weeks ago

i have tried to save the effect as a widget property, and calling its stop() and start() methods, but it seems to somehow speedup the effect before stopping it

tguerin commented 2 weeks ago

To the question can you control the quantity, the answer is yes, you can define a particleCount. The effects will emit particleCount particles according to the emission rate. For example, if you set 100 as particleCount and 10 particles per second your effect will automatically stop after 10 seconds + (time of travelling for the las emitted particles to complete).

By slowing down, do you mean reducing the number of emitted particles when reaching the end?