• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# EMouseButtons类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中EMouseButtons的典型用法代码示例。如果您正苦于以下问题:C# EMouseButtons类的具体用法?C# EMouseButtons怎么用?C# EMouseButtons使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



EMouseButtons类属于命名空间,在下文中一共展示了EMouseButtons类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: OnMouseDown

        protected override bool OnMouseDown(EMouseButtons button)
        {
            //If atop openly any window to not process
            if (Controls.Count != 1)
                return base.OnMouseDown(button);

            if (button == EMouseButtons.Left)
            {
                if (GetPositionByCursor(out startPosition))
                    pathTest = true;
            }

            if (button == EMouseButtons.Right)
            {
                MapObject mapObject = GetMapObjectByCursor();
                if (mapObject != null)
                {
                    UnitAttack(mapObject);
                }
                else
                {
                    Vec3 position;
                    if (GetPositionByCursor(out position))
                        UnitMove(position);
                }
            }

            return base.OnMouseDown(button);
        }
开发者ID:AKNightHawk,项目名称:AssaultKnights2,代码行数:29,代码来源:PathfindingDemoGameWindow.cs


示例2: OnMouseDown

        protected override bool OnMouseDown( EMouseButtons button )
        {
            if( button == EMouseButtons.Left )
                ToggleEntity();

            return base.OnMouseDown( button );
        }
开发者ID:whztt07,项目名称:SDK,代码行数:7,代码来源:RecastNavigationSystemFunctionalityArea.cs


示例3: OnMouseUp

        protected override bool OnMouseUp(EMouseButtons button)
        {
            //If atop openly any window to not process
            if (Controls.Count != 1)
                return base.OnMouseUp(button);

            return base.OnMouseUp(button);
        }
开发者ID:AKNightHawk,项目名称:AssaultKnights2,代码行数:8,代码来源:BallGameWindow.cs


示例4: OnMouseDown

 protected override bool OnMouseDown( EMouseButtons button )
 {
     if( button == EMouseButtons.Left || button == EMouseButtons.Right )
     {
         Destroy( true );
         return true;
     }
     return base.OnMouseDown( button );
 }
开发者ID:Eneth,项目名称:GAO,代码行数:9,代码来源:EngineLogoWindow.cs


示例5: OnMouseDown

		protected override bool OnMouseDown( EMouseButtons button )
		{
			if( button == EMouseButtons.Left )
			{
				if( GetPositionByCursor( out startPosition ) )
					pathTest = true;
			}
			return base.OnMouseDown( button );
		}
开发者ID:whztt07,项目名称:SDK,代码行数:9,代码来源:GridBasedNavigationSystemFunctionalityArea.cs


示例6: OnMouseDown

        protected override bool OnMouseDown( EMouseButtons button )
        {
            //If atop openly any window to not process
            if( Controls.Count != 1 )
                return base.OnMouseDown( button );

            if( !FreeCameraEnabled && button == EMouseButtons.Left )
            {
                if( IsCursorOverCatapult() )
                {
                    catapultFiring = true;
                    catapultFiringMouseStartPosition = MousePosition;
                    return true;
                }
            }

            if( button == EMouseButtons.Right )
            {
                //remove all CatapultBullet

                List<Entity> list = new List<Entity>();
                foreach( Entity entity in Map.Instance.Children )
                {
                    if( entity.Type.Name == "CatapultGame_CatapultBullet" )
                        list.Add( entity );
                }

                foreach( Entity entity in list )
                    entity.SetForDeletion( true );

            }

            return base.OnMouseDown( button );
        }
开发者ID:whztt07,项目名称:SDK,代码行数:34,代码来源:CatapultDemoGameWindow.cs


示例7: SystemKeyboardMouseValue

 public SystemKeyboardMouseValue( EMouseButtons mouseButton )
 {
     type = Types.MouseButton;
     this.mouseButton = mouseButton;
 }
开发者ID:whztt07,项目名称:SDK,代码行数:5,代码来源:GameControlsManager.cs


示例8: OnMouseUp

        protected override bool OnMouseUp( EMouseButtons button )
        {
            //If atop openly any window to not process
            if( Controls.Count != 1 )
                return base.OnMouseUp( button );

            //do tasks
            if( ( button == EMouseButtons.Right || button == EMouseButtons.Left ) &&
                ( !FreeCameraMouseRotating || !EngineApp.Instance.MouseRelativeMode ) )
            {
                bool pickingSuccess = false;
                Vec3 mouseMapPos = Vec3.Zero;
                Unit mouseOnObject = null;

                //pick on active area
                if( IsMouseInActiveArea() )
                {
                    //get pick information
                    Ray ray = RendererWorld.Instance.DefaultCamera.GetCameraToViewportRay(
                        EngineApp.Instance.MousePosition );
                    if( !float.IsNaN( ray.Direction.X ) )
                    {
                        RayCastResult result = PhysicsWorld.Instance.RayCast( ray,
                            (int)ContactGroup.CastOnlyContact );
                        if( result.Shape != null )
                        {
                            pickingSuccess = true;
                            mouseOnObject = MapSystemWorld.GetMapObjectByBody( result.Shape.Body ) as Unit;
                            mouseMapPos = result.Position;
                        }
                    }
                }

                //pick on minimap
                if( minimapControl.GetScreenRectangle().IsContainsPoint( MousePosition ) )
                {
                    pickingSuccess = true;
                    Vec2 pos = GetMapPositionByMouseOnMinimap();
                    mouseMapPos = new Vec3( pos.X, pos.Y, GridPathFindSystem.Instance.GetMotionMapHeight( pos ) );
                }

                if( pickingSuccess )
                {
                    //do tasks
                    if( TaskTargetChooseIndex != -1 )
                    {
                        if( button == EMouseButtons.Left )
                            DoTaskTargetChooseTasks( mouseMapPos, mouseOnObject );
                        if( button == EMouseButtons.Right )
                            TaskTargetChooseIndex = -1;
                    }
                    else
                    {
                        if( button == EMouseButtons.Right )
                            DoRightClickTasks( mouseMapPos, mouseOnObject );
                    }
                }
            }

            //select mode
            if( selectMode && button == EMouseButtons.Left )
                DoEndSelectMode();

            //minimap mouse change camera position
            if( minimapChangeCameraPosition )
                minimapChangeCameraPosition = false;

            return base.OnMouseUp( button );
        }
开发者ID:huytd,项目名称:fosproject,代码行数:69,代码来源:RTSGameWindow.cs


示例9: OnMouseDown

        protected override bool OnMouseDown( EMouseButtons button )
        {
            //If atop openly any window to not process
            if( Controls.Count != 1 )
                return base.OnMouseDown( button );

            switch( button )
            {
            case EMouseButtons.Left:
                {
                    tryingToMovePiece = GetPieceByCursor();
                    if( tryingToMovePiece != null )
                    {
                        if( EntitySystemWorld.Instance.IsServer() )
                        {
                            //server
                            GameNetworkServer server = GameNetworkServer.Instance;
                            tryingToMovePiece.Server_MoveBegin( server.UserManagementService.ServerUser );
                        }
                        else if( EntitySystemWorld.Instance.IsClientOnly() )
                        {
                            //client
                            tryingToMovePiece.Client_MoveTryToBegin();
                        }
                        else
                        {
                            //single mode
                            tryingToMovePiece.Single_MoveBegin();
                        }

                        Vec2 cursorPosition;
                        GetGameAreaCursorPosition( out cursorPosition );
                        tryingToMovePieceOffset = tryingToMovePiece.Position.ToVec2() - cursorPosition;
                        return true;
                    }
                }
                break;
            }

            return base.OnMouseDown( button );
        }
开发者ID:Eneth,项目名称:GAO,代码行数:41,代码来源:JigsawPuzzleGameWindow.cs


示例10: OnMouseUp

        protected override bool OnMouseUp(EMouseButtons button)
        {
            //If atop openly any window to not process
            if (Controls.Count != 1)
                return base.OnMouseUp(button);

            //GameControlsManager
            GameControlsManager.Instance.DoMouseUp(button);

            return base.OnMouseUp(button);
        }
开发者ID:AKNightHawk,项目名称:AssaultKnights2,代码行数:11,代码来源:PlatformerDemoGameWindow.cs


示例11: OnMouseDown

        protected override bool OnMouseDown(EMouseButtons button)
        {
            if (demoMode)
            {
                Vec2 viewportSize = RendererWorld.Instance.DefaultViewport.DimensionsInPixels.Size.ToVec2();
                Vec2 offset = 3.0f / viewportSize;
                if (Math.Abs(MousePosition.X - screenTextLastMousePosition.X) > offset.X ||
                    Math.Abs(MousePosition.Y - screenTextLastMousePosition.Y) > offset.Y)
                {
                    lastTimeOfKeyDownOrMouseMove = EngineApp.Instance.Time;
                    screenTextLastMousePosition = MousePosition;
                }
            }

            return base.OnMouseDown(button);
        }
开发者ID:AKNightHawk,项目名称:AssaultKnights2,代码行数:16,代码来源:VillageDemoGameWindow.cs


示例12: DoMouseDown

        /// <summary>
        /// Sends the notice on pressing a mouse button.
        /// </summary>
        /// <param name="button">A value indicating which button was clicked.</param>
        /// <returns><b>true</b> if such system key is used; otherwise, <b>false</b>.</returns>
        public bool DoMouseDown(EMouseButtons button)
        {
            bool handled = false;

            GameControlsManager.SystemKeyboardMouseValue key;
            if (GameControlsManager.Instance.IsAlreadyBinded(button, out key))
            {
                if (GameControlsEvent != null)
                    GameControlsEvent(new GameControlsKeyDownEventData(key.Parent.ControlKey, 1));
                handled = true;
            }

            return handled;
        }
开发者ID:AKNightHawk,项目名称:AssaultKnights2,代码行数:19,代码来源:GameControlsManager.cs


示例13: SystemKeyboardMouseValue

 public SystemKeyboardMouseValue(EMouseButtons mouseButton, float strength)
 {
     type = Types.MouseButton;
     this.mouseButton = mouseButton;
     this.strength = strength;
 }
开发者ID:AKNightHawk,项目名称:AssaultKnights2,代码行数:6,代码来源:GameControlsManager.cs


示例14: IsAlreadyBinded

        /// <summary>
        /// Check if the Given Input is Binded. Return the currently binded control to the input
        /// </summary>
        public bool IsAlreadyBinded(EMouseButtons button, float strength, out SystemKeyboardMouseValue control)
        {
            control = null;
            foreach (GameControlItem item in Items)
            {
                if (item.BindedKeyboardMouseValues.Count <= 0)
                    continue;

                foreach (SystemKeyboardMouseValue value in item.BindedKeyboardMouseValues)
                {
                    if (value.Type == SystemKeyboardMouseValue.Types.MouseButton &&
                        value.MouseButton == button && value.Strength == strength)
                    {
                        control = value;
                        return true;
                    }
                }
            }

            return false;
        }
开发者ID:AKNightHawk,项目名称:AssaultKnights2,代码行数:24,代码来源:GameControlsManager.cs


示例15: OnMouseUp

        protected override bool OnMouseUp( EMouseButtons button )
        {
            //If atop openly any window to not process
            if( Controls.Count != 1 )
                return base.OnMouseUp( button );

            //currentAttachedGuiObject
            if( currentAttachedGuiObject != null )
                currentAttachedGuiObject.ControlManager.DoMouseUp( button );

            //GameControlsManager
            GameControlsManager.Instance.DoMouseUp( button );

            return base.OnMouseUp( button );
        }
开发者ID:CITS4242B2010,项目名称:project2010,代码行数:15,代码来源:ActionGameWindow.cs


示例16: OnMouseDoubleClick

 protected override bool OnMouseDoubleClick(EMouseButtons button)
 {
     if (controlManager != null && !IsScreenFadingOut())
         if (controlManager.DoMouseDoubleClick(button))
             return true;
     return base.OnMouseDoubleClick(button);
 }
开发者ID:AKNightHawk,项目名称:AssaultKnights2,代码行数:7,代码来源:GameEngineApp.cs


示例17: OnMouseUp

		protected override bool OnMouseUp( EMouseButtons button )
		{
			if( button == EMouseButtons.Left && pathTest )
				pathTest = false;
			return base.OnMouseUp( button );
		}
开发者ID:whztt07,项目名称:SDK,代码行数:6,代码来源:GridBasedNavigationSystemFunctionalityArea.cs


示例18: OnMouseDown

        protected override bool OnMouseDown(EMouseButtons button)
        {
            //If atop openly any window to not process
            if (Controls.Count != 1)
                return base.OnMouseDown(button);

            //GameControlsManager
            if (EntitySystemWorld.Instance.Simulation)
            {
                if (!FreeCameraEnabled && !IsCutSceneEnabled())
                {
                    if (GameControlsManager.Instance.DoMouseDown(button))
                        return true;
                }
            }

            return base.OnMouseDown(button);
        }
开发者ID:AKNightHawk,项目名称:AssaultKnights2,代码行数:18,代码来源:PlatformerDemoGameWindow.cs


示例19: OnMouseDown

        protected override bool OnMouseDown(EMouseButtons button)
        {
            //If you click out side the inventory box, and have selected an item, drop that item
            if (GetPlayerUnit().Inventory.CurrentHoldItem != String.Empty)
            {
                Vec2i windowSize = EngineApp.Instance.VideoMode.Size;

                float ix = hudControl.Controls["Inventory"].Position.Value.X * windowSize.X;
                float iy = hudControl.Controls["Inventory"].Position.Value.Y * windowSize.Y;

                float mx = MousePosition.X * windowSize.X;
                float my = MousePosition.Y * windowSize.Y;

                float iw = hudControl.Controls["Inventory"].Size.Value.X;
                float ih = hudControl.Controls["Inventory"].Size.Value.Y;

                if (!(ix < mx && mx < ix + iw &&
                      iy < my && my < iy + ih))
                {
                    //Show item
                    GetPlayerUnit().Inventory.dropItem(GetPlayerUnit(), hudControl);

                    //Make selected icon to mouse
                    ScreenControlManager.Instance.DefaultCursor = @"Cursors\default.png";
                }
            }

            //If atop openly any window to not process
            if (Controls.Count != 1)
                return base.OnMouseDown(button);

            //currentAttachedGuiObject
            if (currentAttachedGuiObject != null)
            {
                currentAttachedGuiObject.ControlManager.DoMouseDown(button);
                return true;
            }

            //GameControlsManager
            if (EntitySystemWorld.Instance.Simulation)
            {
                if (GetRealCameraType() != CameraType.Free && !IsCutSceneEnabled())
                {
                    if (GameControlsManager.Instance.DoMouseDown(button))
                        return true;
                }
            }

            return base.OnMouseDown(button);
        }
开发者ID:huytd,项目名称:fosproject,代码行数:50,代码来源:VHFOSGameWindows.cs


示例20: OnMouseUp

        protected override bool OnMouseUp( EMouseButtons button )
        {
            //If atop openly any window to not process
            if( Controls.Count != 1 )
                return base.OnMouseUp( button );

            switch( button )
            {
            case EMouseButtons.Left:
                if( tryingToMovePiece != null )
                {
                    UpdateShouldSendMovingPiecePositionToServer( true );

                    if( EntitySystemWorld.Instance.IsServer() || EntitySystemWorld.Instance.IsSingle() )
                        tryingToMovePiece.ServerOrSingle_MoveFinish();
                    else
                        tryingToMovePiece.Client_MoveTryToFinish();

                    tryingToMovePiece = null;

                    return true;
                }
                break;
            }

            return base.OnMouseUp( button );
        }
开发者ID:Eneth,项目名称:GAO,代码行数:27,代码来源:JigsawPuzzleGameWindow.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# EPersistenceID类代码示例发布时间:2022-05-24
下一篇:
C# EFRepository类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap