android - 我需要使用我们自己的图像而不是 Canvas 的 android 粒子动画

标签 android android-animation

我正在使用图书馆 jinatonic_Confetti但是不可能添加我们自己的那个粒子的图像。

任何人都可以帮助我获得以下在 IOS 中使用的五彩纸屑动画有添加图像的选项但我想在 android 中做同样的事情 IOS library FOR CONFETTI这个库可以为粒子拍摄图像吗?

请帮我用我自己的图片制作下面的动画。

enter image description here

最佳答案

这是迟到的答案,但我希望有人能从中得到帮助, 有一个很酷的库可以让你更容易地制作像粒子一样的动画, check this library


你可以用这种方式使用多重图像,

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);
            }

关于android - 我需要使用我们自己的图像而不是 Canvas 的 android 粒子动画,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46782836/

相关文章:

android - 主屏幕上的网络应用程序(iphone 风格)?

java - Android/Eclipse 错误 - "Could not find class ' org.jivesoftware.smack.ConnectionConfiguration',从方法引用”

Android View 在视觉上处于正常位置,但实际上 - 在 TranslateAnimation 之后的起始位置

android - 在 Android 上调整谷歌地图 v2 的大小

Android:翻译动画和相对布局

android - 如何让 ViewSwitcher 只包裹当前显示的 View 高度?

android - android环境中的全景图像处理

android - relativeLayout 设置为 wrap_content 与 alignParentRight?

java - 如何在动画之前和之后执行 Action

android - "Run As Android Application"和 "Debug As Android Application"有什么区别?