Search in sources :

Example 1 with ParticleSystem

use of com.plattysoft.leonids.ParticleSystem in project Leonids by plattysoft.

the class EmiterTimeLimitedExampleActivity method onClick.

@Override
public void onClick(View arg0) {
    ParticleSystem ps = new ParticleSystem(this, 100, R.drawable.star_pink, 1000);
    ps.setScaleRange(0.7f, 1.3f);
    ps.setSpeedModuleAndAngleRange(0.07f, 0.16f, 0, 180);
    ps.setRotationSpeedRange(90, 180);
    ps.setAcceleration(0.00013f, 90);
    ps.setFadeOut(200, new AccelerateInterpolator());
    ps.emit(arg0, 100, 2000);
}
Also used : AccelerateInterpolator(android.view.animation.AccelerateInterpolator) ParticleSystem(com.plattysoft.leonids.ParticleSystem)

Example 2 with ParticleSystem

use of com.plattysoft.leonids.ParticleSystem in project Leonids by plattysoft.

the class FollowCursorExampleActivity method onTouchEvent.

@Override
public boolean onTouchEvent(MotionEvent event) {
    switch(event.getAction()) {
        case MotionEvent.ACTION_DOWN:
            // Create a particle system and start emiting
            ps = new ParticleSystem(this, 100, R.drawable.star_pink, 800);
            ps.setScaleRange(0.7f, 1.3f);
            ps.setSpeedRange(0.05f, 0.1f);
            ps.setRotationSpeedRange(90, 180);
            ps.setFadeOut(200, new AccelerateInterpolator());
            ps.emit((int) event.getX(), (int) event.getY(), 40);
            break;
        case MotionEvent.ACTION_MOVE:
            ps.updateEmitPoint((int) event.getX(), (int) event.getY());
            break;
        case MotionEvent.ACTION_UP:
            ps.stopEmitting();
            break;
    }
    return true;
}
Also used : AccelerateInterpolator(android.view.animation.AccelerateInterpolator) ParticleSystem(com.plattysoft.leonids.ParticleSystem)

Example 3 with ParticleSystem

use of com.plattysoft.leonids.ParticleSystem in project Leonids by plattysoft.

the class EmiterIntermediateExampleActivity method onClick.

@Override
public void onClick(View arg0) {
    ParticleSystem ps = new ParticleSystem(this, 100, R.drawable.star_pink, 1000);
    ps.setScaleRange(0.7f, 1.3f);
    ps.setSpeedModuleAndAngleRange(0.07f, 0.16f, 0, 180);
    ps.setRotationSpeedRange(90, 180);
    ps.setAcceleration(0.00013f, 90);
    ps.setFadeOut(200, new AccelerateInterpolator());
    ps.emit(arg0, 100);
}
Also used : AccelerateInterpolator(android.view.animation.AccelerateInterpolator) ParticleSystem(com.plattysoft.leonids.ParticleSystem)

Example 4 with ParticleSystem

use of com.plattysoft.leonids.ParticleSystem in project Leonids by plattysoft.

the class FireworksExampleActivity method onClick.

@Override
public void onClick(View arg0) {
    ParticleSystem ps = new ParticleSystem(this, 100, R.drawable.star_pink, 800);
    ps.setScaleRange(0.7f, 1.3f);
    ps.setSpeedRange(0.1f, 0.25f);
    ps.setRotationSpeedRange(90, 180);
    ps.setFadeOut(200, new AccelerateInterpolator());
    ps.oneShot(arg0, 70);
    ParticleSystem ps2 = new ParticleSystem(this, 100, R.drawable.star_white, 800);
    ps2.setScaleRange(0.7f, 1.3f);
    ps2.setSpeedRange(0.1f, 0.25f);
    ps.setRotationSpeedRange(90, 180);
    ps2.setFadeOut(200, new AccelerateInterpolator());
    ps2.oneShot(arg0, 70);
}
Also used : AccelerateInterpolator(android.view.animation.AccelerateInterpolator) ParticleSystem(com.plattysoft.leonids.ParticleSystem)

Example 5 with ParticleSystem

use of com.plattysoft.leonids.ParticleSystem in project Leonids by plattysoft.

the class OneShotAdvancedExampleActivity method onClick.

@Override
public void onClick(View arg0) {
    // Launch 2 particle systems one for each image
    ParticleSystem ps = new ParticleSystem(this, 100, R.drawable.star_white_border, 800);
    ps.setScaleRange(0.7f, 1.3f);
    ps.setSpeedRange(0.1f, 0.25f);
    ps.setAcceleration(0.0001f, 90);
    ps.setRotationSpeedRange(90, 180);
    ps.setFadeOut(200, new AccelerateInterpolator());
    ps.oneShot(arg0, 100);
}
Also used : AccelerateInterpolator(android.view.animation.AccelerateInterpolator) ParticleSystem(com.plattysoft.leonids.ParticleSystem)

Aggregations

AccelerateInterpolator (android.view.animation.AccelerateInterpolator)5 ParticleSystem (com.plattysoft.leonids.ParticleSystem)5