Exemple #1
0
 public override void OnTouchEnd(Game game_, TouchEventArgs e)
 {
     ScreenOnTouchEnd(e);
     if (e.GetHandled())
     {
         return;
     }
     if (e.GetId() == touchIdMove)
     {
         touchIdMove      = -1;
         game.touchMoveDx = 0;
         game.touchMoveDy = 0;
     }
     if (e.GetId() == touchIdRotate)
     {
         touchIdRotate           = -1;
         game.touchOrientationDx = 0;
         game.touchOrientationDy = 0;
     }
 }
Exemple #2
0
 public override void OnTouchStart(Game game_, TouchEventArgs e)
 {
     touchButtonsEnabled = true;
     ScreenOnTouchStart(e);
     if (e.GetHandled())
     {
         return;
     }
     if (e.GetX() <= game.Width() / 2)
     {
         if (touchIdMove == -1)
         {
             touchIdMove      = e.GetId();
             touchMoveStartX  = e.GetX();
             touchMoveStartY  = e.GetY();
             game.touchMoveDx = 0;
             if (e.GetY() < game.Height() * 50 / 100)
             {
                 game.touchMoveDy = 1;
             }
             else
             {
                 game.touchMoveDy = 0;
             }
         }
     }
     if (((touchIdMove != -1) &&
          (e.GetId() != touchIdMove)) ||
         (e.GetX() > game.Width() / 2))
     {
         if (touchIdRotate == -1)
         {
             touchIdRotate     = e.GetId();
             touchRotateStartX = e.GetX();
             touchRotateStartY = e.GetY();
         }
     }
 }
Exemple #3
0
    public void OnTouchStart(TouchEventArgs e)
    {
        InvalidVersionAllow();
        mouseCurrentX = e.GetX();
        mouseCurrentY = e.GetY();
        mouseleftclick = true;

        for (int i = 0; i < clientmodsCount; i++)
        {
            if (clientmods[i] == null) { continue; }
            clientmods[i].OnTouchStart(this, e);
            if (e.GetHandled())
            {
                return;
            }
        }
    }
Exemple #4
0
 public void OnTouchMove(TouchEventArgs e)
 {
     for (int i = 0; i < clientmodsCount; i++)
     {
         if (clientmods[i] == null) { continue; }
         clientmods[i].OnTouchMove(this, e);
         if (e.GetHandled())
         {
             return;
         }
     }
 }
Exemple #5
0
 public void OnTouchEnd(TouchEventArgs e)
 {
     mouseCurrentX = 0;
     mouseCurrentY = 0;
     for (int i = 0; i < clientmodsCount; i++)
     {
         if (clientmods[i] == null) { continue; }
         clientmods[i].OnTouchEnd(this, e);
         if (e.GetHandled())
         {
             return;
         }
     }
 }
 public override void OnTouchStart(Game game_, TouchEventArgs e)
 {
     touchButtonsEnabled = true;
     ScreenOnTouchStart(e);
     if (e.GetHandled()) { return; }
     if (e.GetX() <= game.Width() / 2)
     {
         if (touchIdMove == -1)
         {
             touchIdMove = e.GetId();
             touchMoveStartX = e.GetX();
             touchMoveStartY = e.GetY();
             game.touchMoveDx = 0;
             if (e.GetY() < game.Height() * 50 / 100)
             {
                 game.touchMoveDy = 1;
             }
             else
             {
                 game.touchMoveDy = 0;
             }
         }
     }
     if (((touchIdMove != -1)
         && (e.GetId() != touchIdMove))
         || (e.GetX() > game.Width() / 2))
     {
         if (touchIdRotate == -1)
         {
             touchIdRotate = e.GetId();
             touchRotateStartX = e.GetX();
             touchRotateStartY = e.GetY();
         }
     }
 }
 public override void OnTouchEnd(Game game_, TouchEventArgs e)
 {
     ScreenOnTouchEnd(e);
     if (e.GetHandled()) { return; }
     if (e.GetId() == touchIdMove)
     {
         touchIdMove = -1;
         game.touchMoveDx = 0;
         game.touchMoveDy = 0;
     }
     if (e.GetId() == touchIdRotate)
     {
         touchIdRotate = -1;
         game.touchOrientationDx = 0;
         game.touchOrientationDy = 0;
     }
 }