Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cant change X and Y values of confettiManager after initialization. #58

Open
UsmanX74 opened this issue Jun 3, 2020 · 0 comments
Open

Comments

@UsmanX74
Copy link

UsmanX74 commented Jun 3, 2020

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant