You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi! I've recently started using this library and it works great! I did come across a scenario which currently isn't supported by the library but which could be a great addition. I am trying to add a fade in effect to each particle and, while this could be implemented specifically, I believe a more generic approach may be better. What I had in mind is adding support for confetti modifiers, which is essentially behaviour that is applied to each confetti individually right before it is drawn on the Canvas.
The modifiers themselves would need access to properties that are currently private so that constraint would need to be relaxed. For this particular fading in scenario, the paint property would need to be public.
The above code sample is simply a suggestion but I am happy to open a PR or discuss this further if this is something of interest!
Thanks!
The text was updated successfully, but these errors were encountered:
Interesting idea @teobaranga! The use case you give with modifying the alpha sounds like a good one indeed. Though it would become complex when doing any internal modifications later and the unforeseen complications it will have on everyone who's using Modifiers. I.e. the alpha value is currently tightly coupled with lifetime, that should in some way act in a separate way.
If in the future anything changes on the alpha calculations it will be hard to test what it will do with anyone who's implementing modifications, what do you think?
I love the idea though for having a way to alter the deeply nested properties for own use by an abstraction like you suggested.
Hi! I've recently started using this library and it works great! I did come across a scenario which currently isn't supported by the library but which could be a great addition. I am trying to add a fade in effect to each particle and, while this could be implemented specifically, I believe a more generic approach may be better. What I had in mind is adding support for confetti modifiers, which is essentially behaviour that is applied to each confetti individually right before it is drawn on the Canvas.
This would involve adding an interface such as
A list of such modifiers can be provided by consumers when building the
ParticleSystem
which can then be propagated down to theConfetti
level.The modifiers would then be applied before the shape is drawn, following something like
The modifiers themselves would need access to properties that are currently private so that constraint would need to be relaxed. For this particular fading in scenario, the
paint
property would need to be public.The above code sample is simply a suggestion but I am happy to open a PR or discuss this further if this is something of interest!
Thanks!
The text was updated successfully, but these errors were encountered: