Exemple #1
0
 /// <summary>
 /// Default constructor
 /// </summary>
 public MousePointer()
 {
     mHotSpot = Point.Zero;
     mLocation = Point.Zero;
     mCurrentDrawRectangle = Rectangle.Empty;
     mState = MousePointerState.Default;
     mDrawRectangles = new Dictionary<MousePointerState, Rectangle>();
     mScreenArea = Rectangle.Empty;
 }
Exemple #2
0
        /// <summary>
        /// Mouse Update Method
        /// </summary>
        /// <param name="move">The amount by which to move the mouse location</param>
        /// <param name="state">The state to switch the mouse to.</param>
        public void Update(Point move, MousePointerState state)
        {
            if (move.X != 0)
            {
                mLocation.X += move.X;
                if (PickedScreenCoordinate.X < ScreenArea.Left)
                    mLocation.X = ScreenArea.Left - mHotSpot.X;
                if (PickedScreenCoordinate.X > ScreenArea.Right)
                    mLocation.X = ScreenArea.Right - mHotSpot.X;
            }

            if (move.Y != 0)
            {
                mLocation.Y += move.Y;
                if (PickedScreenCoordinate.Y < ScreenArea.Top)
                    mLocation.Y = ScreenArea.Top - mHotSpot.Y;
                if (PickedScreenCoordinate.Y > ScreenArea.Bottom)
                    mLocation.Y = ScreenArea.Bottom - mHotSpot.Y;
            }

            if (mState != state)
                State = state;
        }