예제 #1
0
        public override void Touch(ref TouchHandlerParams _params)
        {
            if (!Visible)
            {
                return;
            }

            if (!IsProcessInput)
            {
                return;
            }

            if (_params.Handled)
            {
                return;
            }

            if (!_params.IsGestureAvailable)
            {
                return;
            }

            if (!m_canvasSprite.GetBoundingBoxNoRotation().Contains(_params.Gesture.Position))
            {
                return;
            }

            var screentouchParams = _params.Copy(new Vector2(-(m_canvasSprite.X - m_canvasSprite.OriginX), -(m_canvasSprite.Y - m_canvasSprite.OriginY)));

            TouchCore(ref screentouchParams);

            _params.Handled = screentouchParams.Handled;
        }
예제 #2
0
        public TouchHandlerParams Copy(Vector2 offset)
        {
            var touchParams = new TouchHandlerParams();

            touchParams.Handled            = Handled;
            touchParams.IsGestureAvailable = IsGestureAvailable;
            touchParams.Gesture            = new GestureSample(Gesture.GestureType, Gesture.Timestamp,
                                                               new Vector2(Gesture.Position.X + offset.X, Gesture.Position.Y + offset.Y),
                                                               new Vector2(Gesture.Position2.X + offset.X, Gesture.Position2.Y + offset.Y),
                                                               Gesture.Delta, Gesture.Delta2);

            return(touchParams);
        }
예제 #3
0
        public TouchHandlerParams GetTouchInput()
        {
            var touchParams = new TouchHandlerParams();

            touchParams.IsGestureAvailable = TouchPanel.IsGestureAvailable;

            if (touchParams.IsGestureAvailable)
            {
                touchParams.Gesture = TouchPanel.ReadGesture();
            }

            return(touchParams);
        }
예제 #4
0
 protected virtual void TouchCore(ref TouchHandlerParams _params)
 {
 }
예제 #5
0
 public virtual void Touch(ref TouchHandlerParams _params)
 {
 }