plattysoft / Leonids

A Particle System for standard Android UI: http://plattysoft.github.io/Leonids/
Apache License 2.0
2.28k stars 398 forks source link

Awesome library, need help with acceleration emitter. #94

Open kylin17 opened 6 years ago

kylin17 commented 6 years ago

I want my particles emitter emission from bottom to top direction, and I found example activity "Emit with Gravity" similarly, so I changed the code below to made it emission with 270 angle:

new ParticleSystem(this, 100, R.drawable.star_pink, 3000)
        .setAcceleration(0.00013f, 270)
        .setSpeedByComponentsRange(0f, 0f, 0.05f, 0.1f)
        .setFadeOut(200, new AccelerateInterpolator())
        .emitWithGravity(arg0, Gravity.TOP, 30);

But the result is the particles first little down then emission from bottom to top. How should I do to avoid that little down?