Esempio n. 1
0
        /// <summary>
        /// Touch event informations
        /// </summary>
        /// <param name="screenTransformationMatrixProvider"></param>
        /// <param name="time"></param>
        /// <param name="location"></param>
        public TouchEventArgs(
            IScreenTransformationMatrixProvider screenTransformationMatrixProvider,
            TimeSpan time,
            TouchLocation location)
        {
            RawTouchLocation = location;
            Time             = time;
            var pointPosition = screenTransformationMatrixProvider?.PointToScreen((int)location.Position.X, (int)location.Position.Y)
                                ?? location.Position.ToPoint();

            Position = new Vector2(pointPosition.X, pointPosition.Y);
        }
Esempio n. 2
0
        /// <summary>
        /// Mouse event infos
        /// </summary>
        /// <param name="screenTransformationMatrixProvider"></param>
        /// <param name="time"></param>
        /// <param name="previousState"></param>
        /// <param name="currentState"></param>
        /// <param name="button"></param>
        public MouseEventArgs(
            IScreenTransformationMatrixProvider screenTransformationMatrixProvider,
            TimeSpan time,
            MouseState previousState,
            MouseState currentState,
            MouseButton button = MouseButton.None)
        {
            PreviousState = previousState;
            CurrentState  = currentState;
            var pointPosition = screenTransformationMatrixProvider?.PointToScreen(currentState.X, currentState.Y)
                                ?? new Point(currentState.X, currentState.Y);

            Position         = new Vector2(pointPosition.X, pointPosition.Y);
            Button           = button;
            ScrollWheelValue = currentState.ScrollWheelValue;
            ScrollWheelDelta = currentState.ScrollWheelValue - previousState.ScrollWheelValue;
            Time             = time;
        }