Beispiel #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;
        }
Beispiel #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);
        }
        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);
        }
Beispiel #4
0
 private void OnMouseMoveEvent(MouseMotionEvent e)
 {
     if (IsPositionLocked)
     {
         MouseState.HandleMouseDelta(new Vector2(e.Xrel, e.Yrel));
     }
     else
     {
         MouseState.HandleMove(new Vector2(e.X, e.Y));
     }
 }
Beispiel #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);
            }
        }
Beispiel #6
0
 private void handleButtonMouseMotionAction(MouseMotionEvent e)
 {
     if (this.HoverEnabled)
     {
         if (isInBounds(e.X, e.Y))
         {
             imgState = MyButtonState.Hover;
         }
         else
         {
             imgState = MyButtonState.Idle;
         }
     }
 }
Beispiel #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);
 }
Beispiel #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));
 }
Beispiel #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);
 }
Beispiel #10
0
 public override bool mouseMoved(MouseMotionEvent evt)
 {
     return(false); // propgate further;
 }
Beispiel #11
0
 public void ProcessMouseEvent(MouseMotionEvent motion)
 {
     state.X += motion.Xrel;
     state.Y += motion.Yrel;
 }
Beispiel #12
0
 protected override void MouseDragged(MouseMotionEvent e)
 {
     MouseMotion(e);
 }
Beispiel #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);
     }
 }
Beispiel #14
0
 protected override void MouseMotion(MouseMotionEvent e)
 {
     GuiSystem.Instance.InjectMouseMove(e.DeltaX * mRenderWindow.Width,
                                        e.DeltaY * mRenderWindow.Height);
 }
Beispiel #15
0
 protected override void MouseDragged(MouseMotionEvent e)
 {
     //base.MouseDragged (e);
     this.MouseMotion(e);
 }