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


C# EMouseButtons类代码示例

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


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


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