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


C# MouseEventArgs.GetY方法代码示例

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


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

示例1: HandleMouseMove

 public void HandleMouseMove(MouseEventArgs e)
 {
     float dx = e.GetMovementX();
     float dy = e.GetMovementY();
     previousMouseX = e.GetX();
     previousMouseY = e.GetY();
     if (mousePressed)
     {
         //            ySpeed += dx / 10;
         //            xSpeed += dy / 10;
     }
     screen.OnMouseMove(e);
 }
开发者ID:YoungGames,项目名称:manicdigger,代码行数:13,代码来源:MainMenu.ci.cs

示例2: MouseMove

 void MouseMove(MouseEventArgs e)
 {
     if (e.GetEmulated())
     {
         return;
     }
     for (int i = 0; i < WidgetCount; i++)
     {
         MenuWidget w = widgets[i];
         if (w != null)
         {
             w.hover = pointInRect(e.GetX(), e.GetY(), w.x, w.y, w.sizex, w.sizey);
         }
     }
 }
开发者ID:YoungGames,项目名称:manicdigger,代码行数:15,代码来源:MainMenu.ci.cs

示例3: HandleMouseDown

 public void HandleMouseDown(MouseEventArgs e)
 {
     mousePressed = true;
     previousMouseX = e.GetX();
     previousMouseY = e.GetY();
     screen.OnMouseDown(e);
 }
开发者ID:YoungGames,项目名称:manicdigger,代码行数:7,代码来源:MainMenu.ci.cs

示例4: OnMouseDown

    public override void OnMouseDown(Game game_, MouseEventArgs args)
    {
        if (game.guistate != GuiState.Inventory)
        {
            return;
        }
        PointRef scaledMouse = PointRef.Create(args.GetX(), args.GetY());

        //material selector
        if (SelectedMaterialSelectorSlot(scaledMouse) != null)
        {
            //int oldActiveMaterial = ActiveMaterial.ActiveMaterial;
            game.ActiveMaterial = SelectedMaterialSelectorSlot(scaledMouse).value;
            //if (oldActiveMaterial == ActiveMaterial.ActiveMaterial)
            {
                Packet_InventoryPosition p = new Packet_InventoryPosition();
                p.Type = Packet_InventoryPositionTypeEnum.MaterialSelector;
                p.MaterialId = game.ActiveMaterial;
                controller.InventoryClick(p);
            }
            args.SetHandled(true);
            return;
        }

        if (game.guistate != GuiState.Inventory)
        {
            return;
        }

        //main inventory
        PointRef cellInPage = SelectedCell(scaledMouse);
        //grab from inventory
        if (cellInPage != null)
        {
            if (args.GetButton() == MouseButtonEnum.Left)
            {
                Packet_InventoryPosition p = new Packet_InventoryPosition();
                p.Type = Packet_InventoryPositionTypeEnum.MainArea;
                p.AreaX = cellInPage.X;
                p.AreaY = cellInPage.Y + ScrollLine;
                controller.InventoryClick(p);
                args.SetHandled(true);
                return;
            }
            else
            {
                {
                    Packet_InventoryPosition p = new Packet_InventoryPosition();
                    p.Type = Packet_InventoryPositionTypeEnum.MainArea;
                    p.AreaX = cellInPage.X;
                    p.AreaY = cellInPage.Y + ScrollLine;
                    controller.InventoryClick(p);
                }
                {
                    Packet_InventoryPosition p = new Packet_InventoryPosition();
                    p.Type = Packet_InventoryPositionTypeEnum.WearPlace;
                    p.WearPlace = WearPlace_.RightHand;
                    p.ActiveMaterial = game.ActiveMaterial;
                    controller.InventoryClick(p);
                }
                {
                    Packet_InventoryPosition p = new Packet_InventoryPosition();
                    p.Type = Packet_InventoryPositionTypeEnum.MainArea;
                    p.AreaX = cellInPage.X;
                    p.AreaY = cellInPage.Y + ScrollLine;
                    controller.InventoryClick(p);
                }
            }
            if (game.guistate == GuiState.Inventory)
            {
                args.SetHandled(true);
                return;
            }
        }
        // //drop items on ground
        //if (scaledMouse.X < CellsStartX() && scaledMouse.Y < MaterialSelectorStartY())
        //{
        //    int posx = game.SelectedBlockPositionX;
        //    int posy = game.SelectedBlockPositionY;
        //    int posz = game.SelectedBlockPositionZ;
        //    Packet_InventoryPosition p = new Packet_InventoryPosition();
        //    {
        //        p.Type = Packet_InventoryPositionTypeEnum.Ground;
        //        p.GroundPositionX = posx;
        //        p.GroundPositionY = posy;
        //        p.GroundPositionZ = posz;
        //    }
        //    controller.InventoryClick(p);
        //}
        if (SelectedWearPlace(scaledMouse) != null)
        {
            Packet_InventoryPosition p = new Packet_InventoryPosition();
            p.Type = Packet_InventoryPositionTypeEnum.WearPlace;
            p.WearPlace = (SelectedWearPlace(scaledMouse).value);
            p.ActiveMaterial = game.ActiveMaterial;
            controller.InventoryClick(p);
            args.SetHandled(true);
            return;
        }
        if (scaledMouse.X >= ScrollUpButtonX() && scaledMouse.X < ScrollUpButtonX() + ScrollButtonSize()
//.........这里部分代码省略.........
开发者ID:MagistrAVSH,项目名称:manicdigger,代码行数:101,代码来源:GuiInventory.ci.cs

示例5: OnMouseUp

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

示例6: OnMouseDown

 public override void OnMouseDown(Game game_, MouseEventArgs args)
 {
     for (int i = 0; i < chatlines2Count; i++)
     {
         float dx = 20;
         if (!game.platform.IsMousePointerLocked())
         {
             dx += 100;
         }
         float chatlineStartX = dx * game.Scale();
         float chatlineStartY = (90 + i * 25) * game.Scale();
         float chatlineSizeX = 500 * game.Scale();
         float chatlineSizeY = 20 * game.Scale();
         if (args.GetX() > chatlineStartX && args.GetX() < chatlineStartX + chatlineSizeX)
         {
             if (args.GetY() > chatlineStartY && args.GetY() < chatlineStartY + chatlineSizeY)
             {
                 //Mouse over chatline at position i
                 if (chatlines2[i].clickable)
                 {
                     game.platform.OpenLinkInBrowser(chatlines2[i].linkTarget);
                 }
             }
         }
     }
 }
开发者ID:MagistrAVSH,项目名称:manicdigger,代码行数:26,代码来源:GuiChat.ci.cs

示例7: MouseMove

 public void MouseMove(MouseEventArgs e)
 {
     mouseCurrentX = e.GetX();
     mouseCurrentY = e.GetY();
     mouseDeltaX += e.GetMovementX();
     mouseDeltaY += e.GetMovementY();
     for (int i = 0; i < clientmodsCount; i++)
     {
         if (clientmods[i] == null) { continue; }
         clientmods[i].OnMouseMove(this, e);
     }
 }
开发者ID:MagistrAVSH,项目名称:manicdigger,代码行数:12,代码来源:Game.ci.cs

示例8: OnMouseUp

 public override void OnMouseUp(Game game_, MouseEventArgs args) { MouseUp(args.GetX(), args.GetY()); }
开发者ID:MagistrAVSH,项目名称:manicdigger,代码行数:1,代码来源:GameMisc.ci.cs

示例9: MouseMove

 void MouseMove(MouseEventArgs e)
 {
     for (int i = 0; i < WidgetCount; i++)
     {
         MenuWidget w = widgets[i];
         if (w != null)
         {
             w.hover = pointInRect(e.GetX(), e.GetY(), screenx + w.x, screeny + w.y, w.sizex, w.sizey);
         }
     }
 }
开发者ID:MagistrAVSH,项目名称:manicdigger,代码行数:11,代码来源:GameMisc.ci.cs

示例10: MouseMove

 public void MouseMove(MouseEventArgs e)
 {
     if (!e.GetEmulated())
     {
         // Set x and y only for real MouseMove events
         mouseCurrentX = e.GetX();
         mouseCurrentY = e.GetY();
     }
     else
     {
         // Get delta only from emulated events (actual events negate previous ones)
         mouseDeltaX += e.GetMovementX();
         mouseDeltaY += e.GetMovementY();
     }
     for (int i = 0; i < clientmodsCount; i++)
     {
         if (clientmods[i] == null) { continue; }
         clientmods[i].OnMouseMove(this, e);
     }
 }
开发者ID:YoungGames,项目名称:manicdigger,代码行数:20,代码来源:Game.ci.cs


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