Class DragGesture
- Namespace
- Lime
- Assembly
- Lime.dll
public class DragGesture : Gesture
- Inheritance
-
DragGesture
- Derived
- Inherited Members
Constructors
DragGesture(IMotionStrategy)
public DragGesture(DragGesture.IMotionStrategy motionStrategy)
Parameters
motionStrategy
DragGesture.IMotionStrategy
DragGesture(int, DragDirection, bool, float, IMotionStrategy)
public DragGesture(int buttonIndex = 0, DragDirection direction = DragDirection.Any, bool exclusive = false, float dragThreshold = 5, DragGesture.IMotionStrategy motionStrategy = null)
Parameters
buttonIndex
intdirection
DragDirectionexclusive
booldragThreshold
floatmotionStrategy
DragGesture.IMotionStrategy
Fields
DefaultDragThreshold
protected const float DefaultDragThreshold = 5
Field Value
changed
protected Gesture.PollableEvent changed
Field Value
Properties
ButtonIndex
public int ButtonIndex { get; }
Property Value
Direction
public DragDirection Direction { get; }
Property Value
DragThreshold
public float DragThreshold { get; set; }
Property Value
Exclusive
public bool Exclusive { get; set; }
Property Value
LastDragDistance
public Vector2 LastDragDistance { get; }
Property Value
MousePosition
MousePosition depends on DragDirection so (MousePosition - DragDirection).X or Y will always be zero if DragDirection is Vertical or Horizontal respectively. This fact is used when checking for threshold.
public virtual Vector2 MousePosition { get; }
Property Value
MousePressPosition
public Vector2 MousePressPosition { get; }
Property Value
PreviousMousePosition
protected virtual Vector2 PreviousMousePosition { get; }
Property Value
TotalDragDistance
public Vector2 TotalDragDistance { get; }
Property Value
Methods
CanStartDrag()
protected virtual bool CanStartDrag()
Returns
IsChanging()
public bool IsChanging()
Returns
IsDragging()
protected virtual bool IsDragging()
Returns
IsRecognizing()
public bool IsRecognizing()
Returns
OnCancel(Gesture)
protected override void OnCancel(Gesture sender)
Parameters
sender
Gesture
OnUpdate()
protected override bool OnUpdate()
Returns
TryGetDragPosition(out Vector2)
protected virtual bool TryGetDragPosition(out Vector2 position)
Parameters
position
Vector2
Returns
TryGetStartDragPosition(out Vector2)
protected virtual bool TryGetStartDragPosition(out Vector2 position)
Parameters
position
Vector2
Returns
WasBegan()
public bool WasBegan()
Returns
WasChanged()
public bool WasChanged()
Returns
WasEnded()
public bool WasEnded()
Returns
WasEnding()
public bool WasEnding()
Returns
WasRecognized()
public bool WasRecognized()
Returns
Events
Began
Occurs when gesture activates and starts recognition.
public event Action Began
Event Type
Changed
Occurs when drag position is being changed by either user or motion strategy.
public event Action Changed
Event Type
Ended
Occurs when either a user released input or motion strategy is done.
public event Action Ended
Event Type
Ending
Occurs when the drag is completed and the motion defined by motion strategy begins.
public virtual event Action Ending
Event Type
Recognized
Occurs if a user started gesture in a valid direction.
public event Action Recognized