Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

I need particle animation for android with images of our own instead of canvas

I am using the library jinatonic_Confetti but there is no possibility of adding images of that particle of our own.

Can anyone help me to get the following Confetti animation that used in IOS has an option to add images but I want to do the same in android IOS library FOR CONFETTI this library can take images for particles?

please help me to get the following animation with my own images.

enter image description here

like image 773
Bharat Kumar Emani Avatar asked Feb 04 '23 04:02

Bharat Kumar Emani


1 Answers

this is late answer but i hope someone will get help from this, there is cool library that can make things easier for you to animate like particals, check this library


you can use multipal images in this way,

int[] hearts = {R.drawable.red_heart,R.drawable.pink_heart,R.drawable.blue_heart,R.drawable.green_heart}; 

            for (int heart : hearts) {
               new ParticleSystem(this, 100, heart, 3000)
                  .setAcceleration(0.00013f, 90)
                 .setSpeedByComponentsRange(0f, 0f, 0.05f, 0.1f)
                .setFadeOut(200, new AccelerateInterpolator())
                .emitWithGravity(findViewById(R.id.emiter_top), Gravity.BOTTOM, 30);
            }
like image 169
Kaushik Khambhadiya Avatar answered Apr 07 '23 00:04

Kaushik Khambhadiya