当前位置: 首页>>代码示例>>C#>>正文


C# TouchEventArgs.GetY方法代码示例

本文整理汇总了C#中TouchEventArgs.GetY方法的典型用法代码示例。如果您正苦于以下问题:C# TouchEventArgs.GetY方法的具体用法?C# TouchEventArgs.GetY怎么用?C# TouchEventArgs.GetY使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TouchEventArgs的用法示例。


在下文中一共展示了TouchEventArgs.GetY方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: HandleTouchStart

 public void HandleTouchStart(TouchEventArgs e)
 {
     touchId = e.GetId();
     previousTouchX = e.GetX();
     previousTouchY = e.GetY();
     screen.OnTouchStart(e);
 }
开发者ID:YoungGames,项目名称:manicdigger,代码行数:7,代码来源:MainMenu.ci.cs

示例2: OnTouchStart

 public virtual void OnTouchStart(TouchEventArgs e)
 {
     MouseDown(e.GetX(), e.GetY());
 }
开发者ID:YoungGames,项目名称:manicdigger,代码行数:4,代码来源:MainMenu.ci.cs

示例3: HandleTouchMove

    public void HandleTouchMove(TouchEventArgs e)
    {
        screen.OnTouchMove(e);
        if (e.GetId() != touchId)
        {
            return;
        }
        float dx = e.GetX() - previousTouchX;
        float dy = e.GetY() - previousTouchY;
        previousTouchX = e.GetX();
        previousTouchY = e.GetY();

        ySpeed += dx / 10;
        xSpeed += dy / 10;
    }
开发者ID:YoungGames,项目名称:manicdigger,代码行数:15,代码来源:MainMenu.ci.cs

示例4: OnTouchStart

 public override void OnTouchStart(Game game_, TouchEventArgs e)
 {
     MouseEventArgs args = new MouseEventArgs();
     args.SetX(e.GetX());
     args.SetY(e.GetY());
     OnMouseDown(game_, args);
     e.SetHandled(args.GetHandled());
 }
开发者ID:MagistrAVSH,项目名称:manicdigger,代码行数:8,代码来源:GuiInventory.ci.cs

示例5: OnTouchEnd

 public virtual void OnTouchEnd(TouchEventArgs e)
 {
     MouseUp(e.GetX(), e.GetY());
 }
开发者ID:YoungGames,项目名称:manicdigger,代码行数:4,代码来源:MainMenu.ci.cs

示例6: OnTouchStart

    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;
            }
        }
    }
开发者ID:MagistrAVSH,项目名称:manicdigger,代码行数:17,代码来源:Game.ci.cs

示例7: ScreenOnTouchEnd

 public void ScreenOnTouchEnd(TouchEventArgs e)
 {
     MouseUp(e.GetX(), e.GetY());
 }
开发者ID:MagistrAVSH,项目名称:manicdigger,代码行数:4,代码来源:GameMisc.ci.cs

示例8: ScreenOnTouchStart

 public void ScreenOnTouchStart(TouchEventArgs e)
 {
     e.SetHandled(MouseDown(e.GetX(), e.GetY()));
 }
开发者ID:MagistrAVSH,项目名称:manicdigger,代码行数:4,代码来源:GameMisc.ci.cs

示例9: OnTouchStart

 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();
         }
     }
 }
开发者ID:MagistrAVSH,项目名称:manicdigger,代码行数:35,代码来源:GuiTouchButtons.ci.cs

示例10: OnTouchMove

 public override void OnTouchMove(Game game, TouchEventArgs e)
 {
     float one = 1;
     if (e.GetId() == touchIdMove)
     {
         float range = game.Width() * one / 20;
         game.touchMoveDx = e.GetX() - touchMoveStartX;
         game.touchMoveDy = -((e.GetY() - 1) - touchMoveStartY);
         float length = game.Length(game.touchMoveDx, game.touchMoveDy, 0);
         if (e.GetY() < game.Height() * 50 / 100)
         {
             game.touchMoveDx = 0;
             game.touchMoveDy = 1;
         }
         else
         {
             if (length > 0)
             {
                 game.touchMoveDx /= length;
                 game.touchMoveDy /= length;
             }
         }
     }
     if (e.GetId() == touchIdRotate)
     {
         game.touchOrientationDx += (e.GetX() - touchRotateStartX) / (game.Width() * one / 40);
         game.touchOrientationDy += (e.GetY() - touchRotateStartY) / (game.Width() * one / 40);
         touchRotateStartX = e.GetX();
         touchRotateStartY = e.GetY();
     }
 }
开发者ID:MagistrAVSH,项目名称:manicdigger,代码行数:31,代码来源:GuiTouchButtons.ci.cs


注:本文中的TouchEventArgs.GetY方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。