Leonids
Leonids copied to clipboard
Random opacity from range?
Hi, great library! Is there a possibility to generate different opacities for the particles?
Thanks!
Not out of the box I'm afraid. There is an AlphaModifer (to perform fade in and fade out) but not an AlphaInitializer, which is what you want.
You can create the Initializer yourself and modify the code of ParticleSystem to create it and add it to the initializer list.
Now that I think about it, it makes sense to add a "add generic initializer" method to the ParticleSystem class to allow extensions like the one you are asking for.
Ok, thanks for the reply! Is there any way to set bounds for the animation? for example, I want to keep it only within a certain view.
That you can do using the constructor that receives a view Id, in that case the ParticleSystem is created as a child of that View, which means that
a) It is placed at that particular z-index in the hierarchy (original purpose was to put particles on the background) b) It is only as big as the parent (which is what you want)
Note that the parent view must be a ViewGroup, I suggest you use FrameLayout.