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


C# Input.MouseMoveEventArgs类代码示例

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


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

示例1: OnMouseMove

 public bool OnMouseMove(MouseMoveEventArgs e)
 {
     Point p = e.Position;
     if(this.hover != null) {
         if(this.hover.Bounds.Contains(p)) {
             this.hover.OnMouseMove(p-(Size) this.hover.Bounds.Location);
             return true;
         }
     }
     foreach(OpenGLComponent oglc in this.components) {
         if(oglc.Bounds.Contains(p)) {
             if(this.hover != null) {
                 this.hover.OnMouseLeave();
             }
             this.hover = oglc;
             this.hover.OnMouseEnter();
             return true;
         }
     }
     if(this.hover != null) {
         this.hover.OnMouseLeave();
     }
     this.hover = null;
     return false;
 }
开发者ID:KommuSoft,项目名称:Zertz,代码行数:25,代码来源:ComponentContainer.cs

示例2: Mouse_Move

 void Mouse_Move(object sender, MouseMoveEventArgs e)
 {
     if (Mouse[MouseButton.Left])
     {
         AddLine(e.X, e.Y);
     }
 }
开发者ID:RetroAchievements,项目名称:opentk,代码行数:7,代码来源:MouseCursorSimple.cs

示例3: OnMouseMove

        private void OnMouseMove(object sender, MouseMoveEventArgs e)
        {
            if (e.Mouse.LeftButton == ButtonState.Pressed && _touches.Count > 0)
            {
                double now = DateTime.Now.Ticks / TimeSpan.TicksPerMillisecond;
                float xConversion = SparrowSharpApp.Stage.Width / Size.Width;
                float yConversion = SparrowSharpApp.Stage.Height / Size.Height;

                Touch movedTouch = _touches[pointerId];
                movedTouch.PreviousGlobalX = movedTouch.GlobalX;
                movedTouch.PreviousGlobalY = movedTouch.GlobalY;
                movedTouch.TimeStamp = now;
                float xc = e.Mouse.X * xConversion;
                float yc = e.Mouse.Y * yConversion;
                if (movedTouch.GlobalX == xc && movedTouch.GlobalY == yc)
                {
                    movedTouch.Phase = TouchPhase.Stationary;
                }
                else
                {
                    movedTouch.GlobalX = xc;
                    movedTouch.GlobalY = yc;
                    movedTouch.Phase = TouchPhase.Moved;
                }
                if (movedTouch.Target == null || movedTouch.Target.Stage == null)
                {
                    // target could have been removed from stage -> find new target in that case
                    Point updatedTouchPosition = Point.Create(movedTouch.GlobalX, movedTouch.GlobalY);
                    movedTouch.Target = SparrowSharpApp.Root.HitTestPoint(updatedTouchPosition);
                }
            }
            processTouch();
        }
开发者ID:fmotagarcia,项目名称:sparrow-sharp,代码行数:33,代码来源:DesktopViewController.cs

示例4: OnMouseMove

 void OnMouseMove(object sender, MouseMoveEventArgs e)
 {
     if (e.XDelta < 200 && e.YDelta < 200)
     {
         game.OnMouseMove(sender, e);
     }
 }
开发者ID:Fortunos,项目名称:CVAlexLeestemaker,代码行数:7,代码来源:Template.cs

示例5: ProcessMouse

		public static void ProcessMouse(int oriX,int oriY){
			
			EventArgs evnt=null;
			var pressed = false;
			prevMouseState =curMouseState;
			curMouseState = Mouse.GetCursorState ();
            Gwen.Input.InputHandler.HoveredControl =input.m_Canvas.GetControlAt(curMouseState.X - oriX, curMouseState.Y - oriY);
            foreach (var mouseCode in mouseCodes)
				if (curMouseState[mouseCode]!=prevMouseState[mouseCode]){
                    evnt = new MouseButtonEventArgs(curMouseState.X - oriX, curMouseState.Y - oriY, mouseCode, true);//last param bugged
                    //evnt = new MouseButtonEventArgs (curMouseState.X, curMouseState.Y, mouseCode,true);//last param bugged
					if (curMouseState [mouseCode]) {
						pressed = true;
                        Gwen.Input.InputHandler.MouseFocus = Gwen.Input.InputHandler.HoveredControl;
                        OnMouseDown?.Invoke ((MouseButtonEventArgs)evnt);
					} else {
						OnMouseUp?.Invoke ((MouseButtonEventArgs)evnt);

					}
				}
			Vector2 delta =MainWindow.lastPos - new Vector2(curMouseState.X, curMouseState.Y);
			if (Math.Abs (delta.X) > 0 || Math.Abs (delta.Y) > 0) {
				
				evnt = new MouseMoveEventArgs (curMouseState.X-oriX, curMouseState.Y-oriY,(int)delta.X,(int)delta.Y);
				OnMouseMove?.Invoke (evnt as MouseMoveEventArgs);
			}
			input.ProcessMouseMessage (evnt,pressed);
			MainWindow.lastPos = new Vector2 (curMouseState.X, curMouseState.Y);
		}
开发者ID:BreyerW,项目名称:Sharp.Engine,代码行数:29,代码来源:InputHandler.cs

示例6: GameWindow_MouseMove

 private void GameWindow_MouseMove(object sender, MouseMoveEventArgs e)
 {
     if (ButtonState.Pressed == e.Mouse.LeftButton)
     {
         visual.OrbitCamera.Heading += 300 * e.XDelta / (float)gameWindow.Width;
         visual.OrbitCamera.Tilt += 300 * e.YDelta / (float)gameWindow.Height;
     }
 }
开发者ID:danielscherzer,项目名称:Framework,代码行数:8,代码来源:Program.cs

示例7: MouseMove

 protected override void MouseMove( object sender, MouseMoveEventArgs e )
 {
     base.MouseMove( sender, e );
     if( selectedWidget != null && selectedWidget == widgets[tableIndex] ) {
         LauncherTableWidget table = (LauncherTableWidget)widgets[tableIndex];
         table.MouseMove( e.XDelta, e.YDelta );
     }
 }
开发者ID:Daribon,项目名称:ClassicalSharp,代码行数:8,代码来源:ClassiCubeServersScreen.cs

示例8: OnMouseMove

		public override void OnMouseMove (MouseMoveEventArgs evnt)
		{
			//if (isDragging && Selection.assets.Count==0 && tree.SelectedChildren.Any ())
			//	foreach (var asset in tree.SelectedChildren)
			//		Selection.assets.Add (asset.Content);
			
			//canvas.NeedsRedraw = true;
		}
开发者ID:BreyerW,项目名称:Sharp.Engine,代码行数:8,代码来源:AssetsView.cs

示例9: MouseMove

        public override void MouseMove(MouseMoveEventArgs e)
        {
            base.MouseMove(e);

            if (this.IsMouseOver() && !this.ShouldPassInput && !GUIManager.IsPanelAbovePoint(new Vector2(Utilities.engine.Mouse.X, Utilities.engine.Mouse.Y), this))
            {
                System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.Hand;
            }
        }
开发者ID:Foohy,项目名称:OlegEngine,代码行数:9,代码来源:CheckBox.cs

示例10: mouseMoveHandler

        protected virtual void mouseMoveHandler(object sender, MouseMoveEventArgs e)
        {
            if (this.mouseButtonDown) {

                // Console.WriteLine("mouse dragged: {0},{1}",e.XDelta,e.YDelta);
                this.scene.ActiveCamera.MouseDeltaOrient(e.XDelta,e.YDelta);
                // this.activeModel.MouseDeltaOrient(e.XDelta,e.YDelta);
            }
        }
开发者ID:RealRui,项目名称:SimpleScene,代码行数:9,代码来源:TestBenchBootstrap_setupInput.cs

示例11: FromArgs

            public static IEnumerable<GLMouseInput> FromArgs(MouseMoveEventArgs args, int windowWidth, int windowHeight)
            {
                int xDelta = args.X - windowWidth / 2;
                int yDelta = args.Y - windowHeight / 2;

                if (xDelta < 0) yield return new GLMouseInput(InputType.TurnLeft, InputState.Maintained, -xDelta);
                if (xDelta > 0) yield return new GLMouseInput(InputType.TurnRight, InputState.Maintained, xDelta);
                if (yDelta < 0) yield return new GLMouseInput(InputType.TurnUp, InputState.Maintained, -yDelta);
                if (yDelta > 0) yield return new GLMouseInput(InputType.TurnDown, InputState.Maintained, yDelta);
            }
开发者ID:domisterwoozy,项目名称:LabBox,代码行数:10,代码来源:OpenGLInputObservable.cs

示例12: Mouse_Move

        void Mouse_Move(object sender, MouseMoveEventArgs e)
        {
			if (capture_mouse) {
                lock (_mouseDeltas)
                {
                    _mouseDeltas.y = e.YDelta * _mouse_speed;
                    _mouseDeltas.x = e.XDelta * _mouse_speed;
                }
            	//System.Windows.Forms.Cursor.Position = new System.Drawing.Point(500,500);
			}
        }
开发者ID:DynaStudios,项目名称:LD23Jam,代码行数:11,代码来源:Player.cs

示例13: Mouse_Move

 void Mouse_Move(object sender, MouseMoveEventArgs e)
 {
     CurrentMousePosition = new Vector2(e.X / ControlWidth, e.Y / ControlHeight);
     
     // trigger touch move events
     foreach (MouseButton button in Enum.GetValues(typeof(MouseButton)))
     {
         var buttonId = (int)button;
         if (MouseButtonCurrentlyDown[buttonId])
             HandlePointerEvents(buttonId, CurrentMousePosition, PointerState.Move, PointerType.Mouse);
     }
 }
开发者ID:Powerino73,项目名称:paradox,代码行数:12,代码来源:InputManager.OpenTK.cs

示例14: move

 void move(MouseMoveEventArgs e)
 {
     var dx = e.X - lastX;
     var dy = e.Y - lastY;
     lastX = e.X;
     lastY = e.Y;
     rx -= dx*xySpeed;
     ry -= dy*xySpeed;
     if(ry>=89)
         ry=89;
     if(ry<=-89)
         ry=-89;
 }
开发者ID:paolo-slepoi,项目名称:OpenGLTkVerletDemo,代码行数:13,代码来源:MouseTrackBall.cs

示例15: OnMouseMove

 protected override void OnMouseMove(MouseMoveEventArgs e)
 {
     switch (Settings.gameStatus)
     {
         case Settings.GameStatus.Startmenu:
             break;
         case Settings.GameStatus.Gamewindow:
             Game.OnMouseMove(e);
             break;
         default:
             break;
     }
 }
开发者ID:mix3d88,项目名称:Magic-Cube,代码行数:13,代码来源:Window.cs


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