當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。