Java Code Examples for com.plattysoft.leonids.ParticleSystem#setScaleRange()
The following examples show how to use
com.plattysoft.leonids.ParticleSystem#setScaleRange() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: FollowCursorExampleActivity.java From Leonids with Apache License 2.0 | 6 votes |
@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; }
Example 2
Source File: FireworksExampleActivity.java From Leonids with Apache License 2.0 | 6 votes |
@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); }
Example 3
Source File: DrawerActivity.java From Coloring-book with Apache License 2.0 | 5 votes |
public void finish_anim() { Animation animFadein = AnimationUtils.loadAnimation( getApplicationContext(), R.anim.slide_finish); level_finished.setVisibility(View.VISIBLE); animFadein.setAnimationListener(finish_anim); level_finished.startAnimation(animFadein); int count = screenH / 100; for (int i = 0; i < count; i++) { int id_image = 0; if (i % 2 == 0) id_image = R.drawable.star_pink; else id_image = R.drawable.star_white; ParticleSystem ps = new ParticleSystem(this, 100, id_image, 800); ps.setScaleRange(0.7f, 1.3f); ps.setSpeedRange(0.2f, 0.5f); ps.setRotationSpeedRange(90, 180); ps.setFadeOut(200, new AccelerateInterpolator()); int xStart = (int) (screenW * Math.random()); int yStart = (int) (screenH * Math.random()); ps.oneShot(xStart, yStart, 70); } final Animation scale = AnimationUtils.loadAnimation( getApplicationContext(), R.anim.scale_anim); homeBtn.startAnimation(scale); Tracker tracker = GoogleAnalytics.getInstance(this).getTracker("UA-51610813-3"); tracker.send(MapBuilder .createEvent("Level", packName, "finish_drawing_" + level, null) .build()); }
Example 4
Source File: EmiterTimeLimitedExampleActivity.java From Leonids with Apache License 2.0 | 5 votes |
@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); }
Example 5
Source File: EmiterIntermediateExampleActivity.java From Leonids with Apache License 2.0 | 5 votes |
@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); }
Example 6
Source File: OneShotAdvancedExampleActivity.java From Leonids with Apache License 2.0 | 5 votes |
@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); }