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; }
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); }
public TouchHandlerParams GetTouchInput() { var touchParams = new TouchHandlerParams(); touchParams.IsGestureAvailable = TouchPanel.IsGestureAvailable; if (touchParams.IsGestureAvailable) { touchParams.Gesture = TouchPanel.ReadGesture(); } return(touchParams); }
protected virtual void TouchCore(ref TouchHandlerParams _params) { }
public virtual void Touch(ref TouchHandlerParams _params) { }