예제 #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;
 }