예제 #1
0
        private static void ProcessMouseMotionEvent(Sdl2NativeWindow window, MouseMotionEvent ev)
        {
            float scale = window.ClientSize.Width / (float)window.Size.Width;

            window.OnMouseMove(
                (int)Math.Round(ev.X * scale),
                (int)Math.Round(ev.Y * scale));
            Sdl2Mouse.Scale = scale;
        }
예제 #2
0
        public override bool mouseMoved(MouseMotionEvent evt)
        {
            bool ret = BitesPINVOKE.CameraMan_mouseMoved(swigCPtr, MouseMotionEvent.getCPtr(evt));

            if (BitesPINVOKE.SWIGPendingException.Pending)
            {
                throw BitesPINVOKE.SWIGPendingException.Retrieve();
            }
            return(ret);
        }
예제 #3
0
        public virtual bool mouseMoved(MouseMotionEvent evt)
        {
            bool ret = (SwigDerivedClassHasMethod("mouseMoved", swigMethodTypes6) ? BitesPINVOKE.InputListener_mouseMovedSwigExplicitInputListener(swigCPtr, MouseMotionEvent.getCPtr(evt)) : BitesPINVOKE.InputListener_mouseMoved(swigCPtr, MouseMotionEvent.getCPtr(evt)));

            if (BitesPINVOKE.SWIGPendingException.Pending)
            {
                throw BitesPINVOKE.SWIGPendingException.Retrieve();
            }
            return(ret);
        }
예제 #4
0
파일: MouseSDL.cs 프로젝트: Alan-love/xenko
 private void OnMouseMoveEvent(MouseMotionEvent e)
 {
     if (IsPositionLocked)
     {
         MouseState.HandleMouseDelta(new Vector2(e.Xrel, e.Yrel));
     }
     else
     {
         MouseState.HandleMove(new Vector2(e.X, e.Y));
     }
 }
예제 #5
0
        protected override void MouseMotion(MouseMotionEvent e)
        {
            mCameraTarget.Pitch(new Radian(-e.DeltaY * mDeltaTime * 500.0f));
            mCameraTarget.Yaw(new Radian(-e.DeltaX * mDeltaTime * 500.0f));

            if (e.DeltaZ > 0)
            {
                Vector3 initial = mCameraPosition.Position;
                Vector3 final   = new Vector3(initial.x * 1.1f, initial.y * 1.1f, initial.z * 1.1f);
                Vector3 delta   = Vector3.Subtract(initial, final);
                mCameraPosition.Translate(delta, Node.TransformSpace.TS_LOCAL);
            }
            if (e.DeltaZ < 0)
            {
                Vector3 initial = mCameraPosition.Position;
                Vector3 final   = new Vector3(initial.x * 0.9f, initial.y * 0.9f, initial.z * 0.9f);
                Vector3 delta   = Vector3.Subtract(initial, final);
                mCameraPosition.Translate(delta, Node.TransformSpace.TS_LOCAL);
            }
        }
예제 #6
0
 private void handleButtonMouseMotionAction(MouseMotionEvent e)
 {
     if (this.HoverEnabled)
     {
         if (isInBounds(e.X, e.Y))
         {
             imgState = MyButtonState.Hover;
         }
         else
         {
             imgState = MyButtonState.Idle;
         }
     }
 }
예제 #7
0
 /// <summary>
 /// Called when the mouse moves while a mouse button is down.
 /// </summary>
 /// <param name="deltax"></param>
 /// <param name="deltay"></param>
 /// <param name="deltaz"></param>
 protected virtual void MouseDragged(MouseMotionEvent e)
 {
     this.MouseMotion(e);
 }
예제 #8
0
 /// <summary>
 /// Called at the end of a rendering frame.
 /// </summary>
 /// <param name="deltax"></param>
 /// <param name="deltay"></param>
 /// <param name="deltaz"></param>
 protected virtual void MouseMotion(MouseMotionEvent e)
 {
     mCamera.Pitch(new Radian(-e.DeltaY * mDeltaTime * 500.0f));
     mCamera.Yaw(new Radian(-e.DeltaX * mDeltaTime * 500.0f));
 }
예제 #9
0
 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(MouseMotionEvent obj)
 {
     return((obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr);
 }
예제 #10
0
 public override bool mouseMoved(MouseMotionEvent evt)
 {
     return(false); // propgate further;
 }
예제 #11
0
 public void ProcessMouseEvent(MouseMotionEvent motion)
 {
     state.X += motion.Xrel;
     state.Y += motion.Yrel;
 }
예제 #12
0
 protected override void MouseDragged(MouseMotionEvent e)
 {
     MouseMotion(e);
 }
예제 #13
0
 public void handleDraggableMouseMotionEvent(MouseMotionEvent e)
 {
     if (Moving)
     {
         this.Bounds = new Rectangle(this.Bounds.X + e.DX, this.Bounds.Y + e.DY, this.Bounds.Width, this.Bounds.Height);
     }
 }
예제 #14
0
 protected override void MouseMotion(MouseMotionEvent e)
 {
     GuiSystem.Instance.InjectMouseMove(e.DeltaX * mRenderWindow.Width,
                                        e.DeltaY * mRenderWindow.Height);
 }
예제 #15
0
 protected override void MouseDragged(MouseMotionEvent e)
 {
     //base.MouseDragged (e);
     this.MouseMotion(e);
 }