erikwatson / snowfall.js

Stay cool ☃️
https://erikwatson.github.io/snowfall.js/
MIT License
4 stars 2 forks source link

Add option to stop showing snow. #28

Closed aciccarello closed 2 years ago

aciccarello commented 2 years ago

I'd like to have a button where the user can stop the snow animation but there is no method to do so. My current workaround is to set gravity to zero. However this isn't perfect because running start again will cause the snow to fall with a higher gravity version than expected.

erikwatson commented 2 years ago

Hey @aciccarello, sorry I didn't see this issue earlier. I've just pushed a new version, 3.1.0 that should have you covered.

There's now a snowfall.setPaused(true/false) and a snowfall.togglePaused() available. Relevant commit: 5a804a1faff44a77bcb23b54a2cbc6af9c2b7a30

aciccarello commented 2 years ago

Thanks for adding that. I just took a look and the minified release on npm seems to be missing the new methods.

erikwatson commented 2 years ago

Oh man, so sorry @aciccarello! I have corrected that now, do let me know if you have any other problems with it.

aciccarello commented 2 years ago

That worked great! Thanks!