安卓轻量的粒子效果系统库

作者: DeanWang | 来源:发表于2016-02-23 15:16 被阅读280次
    ezgif.com-video-to-gif (1).gif

    https://github.com/plattysoft/Leonids

    使用简单:

    初始化:
    <pre>
    practiceView = new View(this);
    RelativeLayout.LayoutParams lp = new RelativeLayout.LayoutParams(
    RelativeLayout.LayoutParams.MATCH_PARENT, RelativeLayout.LayoutParams.MATCH_PARENT);
    lp.topMargin = 200;
    addContentView(practiceView, lp);
    </pre>
    调用显示:
    <pre>
    void playPracticle(){
    ParticleSystem particleSystem = new ParticleSystem(this, 300, R.mipmap.ic_launcher, 1000)
    .setSpeedRange(0.06f, 0.6f)
    .setScaleRange(0.125f, 0.5f)
    .setRotationSpeedRange(0.1f, 0.8f)
    .setFadeOut(800, new android.view.animation.LinearInterpolator())
    .setAcceleration(0.001f, 90);

    particleSystem.emitWithGravity(this.practiceView, Gravity.TOP | Gravity.CENTER_HORIZONTAL, 300, 1000);//.oneShot(wv.practiceView, 100);
    

    }
    </pre>

    相关文章

      网友评论

        本文标题:安卓轻量的粒子效果系统库

        本文链接:https://www.haomeiwen.com/subject/yrgbkttx.html