jinatonic/confetti

Cant change X and Y values of confettiManager after initialization.

Opened this issue · 0 comments

Hello, Thank you for this wonderful library.

I'm having a little trouble understanding if I'm doing things the right way. I created my own custom confetto using ConfettoGenerator and then initialized my ConfettiManager like this:

confettoGenerator = new ConfettoGenerator() {
            @Override
            public Confetto generateConfetto(Random random) {
                return new Particles(Assets.particle_blue);
            }
        };

confettiSource = new ConfettiSource(sW,sH/2);
        mConfetti = new ConfettiManager(getContext(), confettoGenerator, confettiSource, (ViewGroup) this.getParent().getParent())
                .setEmissionDuration(700)
                .setVelocityX(-100)
                .setTTL(700);

Now I'm able to draw my animation in my onDraw() method by simply doing confettiManager.animate() but what if I want to change the X and Y values during animation. For example, moving the animation as the user moves their finger on screen? Am I missing something since clearly I should not have to create a new confettiManager each time I wanna move the same animation and I must avoid object allocation at all costs in my onDraw() method.

Looking forward to your reply, thanks once again.