示例#1
0
 public override bool OnTouchEvent(MotionEvent e)
 {
     if (!mShouldFollowTouch)
         return  base.OnTouchEvent(e);
     switch (e.Action)
     {
         case MotionEventActions.Down:
             mParticleSystem1 = new ParticleSystem(this, 100, Resource.Drawable.star_dark, 800);
             mParticleSystem1.SetScaleRange(0.7f, 1.3f);
             mParticleSystem1.SetSpeedRange(0.05f, 0.1f);
             mParticleSystem1.SetRotationSpeedRange(90, 180);
             mParticleSystem1.SetFadeOut(200, new AccelerateInterpolator());
             mParticleSystem1.Emit((int)e.GetX(), (int)e.GetY(), 40);
             break;
         case MotionEventActions.Move:
             mParticleSystem1.UpdateEmitPoint((int)e.GetX(), (int)e.GetY());
             break;
         case MotionEventActions.Up:
             mParticleSystem1.StopEmitting();
             break;
     }
     return true;
 }
示例#2
0
 void OneShotAdvanced()
 {
     mParticleSystem1 = new ParticleSystem(this, 100, Resource.Drawable.star_dark, 2000);
     mParticleSystem1.SetScaleRange(0.7f, 1.3f);
     mParticleSystem1.SetSpeedRange(0.1f, 0.25f);
     mParticleSystem1.SetAcceleration(0.0001f, 90);
     mParticleSystem1.SetRotationSpeedRange(90, 180);
     mParticleSystem1.SetFadeOut(200, new AccelerateInterpolator());
     mParticleSystem1.OneShot(mTextView, 100);
 }
示例#3
0
 void EmitTimeLimited()
 {
     mParticleSystem1 = new ParticleSystem(this, 100, Resource.Drawable.star_dark, 1000);
     mParticleSystem1.SetScaleRange(0.7f, 1.3f);
     mParticleSystem1.SetSpeedModuleAndAngleRange(0.07f, 0.16f, 0, 180);
     mParticleSystem1.SetRotationSpeedRange(90, 180);
     mParticleSystem1.SetAcceleration(0.00013f, 90);
     mParticleSystem1.SetFadeOut(200, new AccelerateInterpolator());
     mParticleSystem1.Emit(mTextView, 100, 2000);
 }
示例#4
0
        void Fireworks()
        {
            mParticleSystem1 = new ParticleSystem(this, 100, Resource.Drawable.star_dark, 800);
            mParticleSystem1.SetScaleRange(0.7f, 1.3f);
            mParticleSystem1.SetSpeedRange(0.1f, 0.25f);
            mParticleSystem1.SetRotationSpeedRange(90, 180);
            mParticleSystem1.SetFadeOut(200, new AccelerateInterpolator());
            mParticleSystem1.OneShot(mTextView, 70);

            mParticleSystem2 = new ParticleSystem(this, 100, Resource.Drawable.star_white, 800);
            mParticleSystem2.SetScaleRange(0.7f, 1.3f);
            mParticleSystem2.SetSpeedRange(0.1f, 0.25f);
            mParticleSystem2.SetRotationSpeedRange(90, 180);
            mParticleSystem2.SetFadeOut(200, new AccelerateInterpolator());
            mParticleSystem2.OneShot(mTextView, 70);
        }
示例#5
0
 void AnimatedParticles()
 {
     mParticleSystem1 = new ParticleSystem(this, 100, Resource.Drawable.animated_confetti, 5000);
     mParticleSystem1.SetSpeedRange(0.1f, 0.25f);
     mParticleSystem1.SetRotationSpeedRange(90, 180);
     mParticleSystem1.SetInitialRotationRange(0, 360);
     mParticleSystem1.OneShot(mTextView, 100);
 }