示例#1
0
        /// <summary>
        /// Create a default drag gesture configuration for one finger dragging.
        /// </summary>
        /// <param name="dragShape">The dragging shape</param>
        public GestureConfigDrag(GestureShape dragShape)
        {
            AssociatedGestureType = GestureType.Drag;

            DragShape = dragShape;
            RequiredNumberOfFingers = 1;
            AllowedErrorMargins     = 0.02f * Vector2.One;
            MinimumDragDistance     = 0.02f;
        }
示例#2
0
        /// <summary>
        /// Create a default gesture configuration for one finger flicking.
        /// </summary>
        /// <param name="flickShape">The shape of the flicking.</param>
        public GestureConfigFlick(GestureShape flickShape)
        {
            AssociatedGestureType = GestureType.Flick;

            FlickShape = flickShape;
            RequiredNumberOfFingers = 1;
            MinimumAverageSpeed     = 0.4f;
            MinimumFlickLength      = 0.04f;
            AllowedErrorMargins     = 0.02f * Vector2.One;
        }
 internal GestureEventTranslation(GestureType type, GestureState state, int numberOfFingers, TimeSpan deltaTime, TimeSpan totalTime, 
                                   GestureShape shape, Vector2 startPos, Vector2 currPos, Vector2 deltaTrans)
 {
     Type = type;
     State = state;
     NumberOfFinger = numberOfFingers;
     DeltaTime = deltaTime;
     TotalTime = totalTime;
     Shape = shape;
     StartPosition = startPos;
     CurrentPosition = currPos;
     DeltaTranslation = deltaTrans;
     TotalTranslation = currPos - startPos;
     AverageSpeed = TotalTranslation / (float)(TotalTime.TotalSeconds + 0.0001f); // avoid division by zero
 }
示例#4
0
 internal GestureEventTranslation(GestureType type, GestureState state, int numberOfFingers, TimeSpan deltaTime, TimeSpan totalTime,
                                  GestureShape shape, Vector2 startPos, Vector2 currPos, Vector2 deltaTrans)
 {
     Type             = type;
     State            = state;
     NumberOfFinger   = numberOfFingers;
     DeltaTime        = deltaTime;
     TotalTime        = totalTime;
     Shape            = shape;
     StartPosition    = startPos;
     CurrentPosition  = currPos;
     DeltaTranslation = deltaTrans;
     TotalTranslation = currPos - startPos;
     AverageSpeed     = TotalTranslation / (float)(TotalTime.TotalSeconds + 0.0001f); // avoid division by zero
 }
示例#5
0
 internal void Set(GestureState state, int numberOfFingers, TimeSpan deltaTime, TimeSpan totalTime,
                   GestureShape shape, Vector2 startPos, Vector2 currPos, Vector2 deltaTrans)
 {
     base.Set(GestureType.Drag, state, numberOfFingers, deltaTime, totalTime, shape, startPos, currPos, deltaTrans);
 }
示例#6
0
        /// <summary> 
        /// Create a default drag gesture configuration for one finger dragging.
        /// </summary>
        /// <param name="dragShape">The dragging shape</param>
        public GestureConfigDrag(GestureShape dragShape)
        {
            AssociatedGestureType = GestureType.Drag;

            DragShape = dragShape;
            RequiredNumberOfFingers = 1;
            AllowedErrorMargins = 0.02f * Vector2.One;
            MinimumDragDistance = 0.02f;
        }
示例#7
0
 internal GestureEventDrag(GestureState state, int numberOfFingers, TimeSpan deltaTime, TimeSpan totalTime,
                           GestureShape shape, Vector2 startPos, Vector2 currPos, Vector2 deltaTrans)
     : base(GestureType.Drag, state, numberOfFingers, deltaTime, totalTime, shape, startPos, currPos, deltaTrans)
 {
 }
示例#8
0
 internal void Set(int numberOfFingers, TimeSpan time, GestureShape shape, Vector2 startPos, Vector2 currPos)
 {
     Set(GestureType.Flick, GestureState.Occurred, numberOfFingers, time, time, shape, startPos, currPos, currPos - startPos);
 }
 internal GestureEventFlick(int numberOfFingers, TimeSpan time, GestureShape shape, Vector2 startPos, Vector2 currPos)
     : base(GestureType.Flick, GestureState.Occurred, numberOfFingers, time, time, shape, startPos, currPos, currPos - startPos)
 {
 }
示例#10
0
 internal GestureEventFlick( int numberOfFingers, TimeSpan time, GestureShape shape, Vector2 startPos, Vector2 currPos)
     :base(GestureType.Flick, GestureState.Occurred, numberOfFingers, time, time, shape, startPos, currPos, currPos-startPos)
 {
 }
示例#11
0
 internal GestureEventDrag(GestureState state, int numberOfFingers, TimeSpan deltaTime, TimeSpan totalTime,
                             GestureShape shape, Vector2 startPos, Vector2 currPos, Vector2 deltaTrans)
     :base(GestureType.Drag, state, numberOfFingers, deltaTime,totalTime,shape,startPos,currPos,deltaTrans)
 {
 }
示例#12
0
        /// <summary>
        /// Create a default gesture configuration for one finger flicking.
        /// </summary>
        /// <param name="flickShape">The shape of the flicking.</param>
        public GestureConfigFlick(GestureShape flickShape)
        {
            AssociatedGestureType = GestureType.Flick;

            FlickShape = flickShape;
            RequiredNumberOfFingers = 1;
            MinimumAverageSpeed = 0.4f;
            MinimumFlickLength = 0.04f;
            AllowedErrorMargins = 0.02f * Vector2.One;
        }