GestureRecognizer Class |
Namespace: DigitalRubyShared
public class GestureRecognizer : IDisposable
The GestureRecognizer type exposes the following members.
Name | Description | |
---|---|---|
GestureRecognizer |
Constructor
|
Name | Description | |
---|---|---|
AllowSimultaneousExecutionIfPlatformSpecificViewsAreDifferent |
Allows simultaneous execution if the platform specific views do no match. Default is true.
| |
ClearTrackedTouchesOnEndOrFail |
Whether tracked touches are cleared when the gesture ends or fails, default is false. By setting to true, you allow the gesture to
possibly execute again with a different touch even if the original touch it failed on is still on-going. This is a special case,
so be sure to watch for problems if you set this to true, as leaving it false ensures the most correct behavior, especially
with lots of gestures at once.
| |
CurrentTrackedTouches |
The current tracked touches for the gesture
| |
CustomData |
Custom data for the gesture that you can attach, or just leave null if you don't need this
This is useful if you want to retrieve this in a callback function, but it is not require
for the gesture to work properly
| |
DeltaX |
Change in focus x in pixels
| |
DeltaY |
Change in focus y in pixels
| |
DistanceX |
The distance (in pixels) the gesture focus has moved from where it started along the x axis
| |
DistanceY |
The distance (in pixels) the gesture focus has moved from where it started along the y axis
| |
Enabled |
Whether the gesture is Enabled. Default is true.
| |
FocusX |
Focus x value in pixels (average of all touches)
| |
FocusY |
Focus y value in pixels (average of all touches)
| |
IsRestarting |
True if gesture is in process of restarting, false otherwise
| |
MaximumNumberOfTouchesToTrack |
The maximum number of touches to track. This gesture will never track more touches than this. Default is usually 1 or 2.
Not all gestures will honor values higher than 1.
| |
MinimumNumberOfTouchesToTrack |
The minimum number of touches to track. This gesture will not start unless this many touches are tracked. Default is usually 1 or 2.
Not all gestures will honor values higher than 1.
| |
PlatformSpecificView |
A platform specific view object that this gesture can execute in, null if none
| |
PlatformSpecificViewScale |
The platform specific view scale (default is 1.0). Change this if the view this gesture is attached to is being scaled.
| |
Pressure |
Average pressure of all tracked touches
| |
PrevFocusX |
Previous focus x
| |
PrevFocusY |
Previous focus y
| |
ReceivedAdditionalTouches |
Whether additional touches were added to the gesture since the last execute state.
| |
RequireGestureRecognizersToFail |
If this gesture reaches the EndPending state and the specified gestures fail,
this gestures will end. If the specified gesture begins, executes or ends,
then this gesture will immediately fail.
| |
RequireGestureRecognizerToFail |
Convenience method to add / remove one gesture to require failure on. Set to null to clear all require gestures to fail.
| |
ResetOnEnd |
Whether the gesture should reset when it ends
| |
Speed |
The speed of the gesture in pixels using focus
| |
StartFocusX |
Start focus x value in pixels (average of all touches)
| |
StartFocusY |
Start focus y value in pixels (average of all touches)
| |
State |
Get the current gesture recognizer state
| |
TrackedTouchCountIsWithinRange |
Whether the current number of tracked touches is within the min and max number of touches to track
| |
VelocityX |
Velocity x in pixels using focus
| |
VelocityY |
Velocity y in pixels using focus
|
Name | Description | |
---|---|---|
AddRequiredGestureRecognizerToFail |
Require a gesture to fail in order for this gesture to end
| |
AllowSimultaneousExecution |
Allows the simultaneous execution with other gesture. This links both gestures so this method
only needs to be called once on one of the gestures.
Pass null to allow simultaneous execution with all gestures.
| |
AllowSimultaneousExecutionWithAllGestures |
Allows simultaneous execution with all gestures
| |
AreTrackedTouchesWithinDistance |
Determines whether any tracked touches are within the distance of the starting point of each tracked touch.
| |
BeginGestureRestart |
Allows the gesture to restart even if the touches are not lifted. This is only valid when called from the "Ended" state.
| |
CalculateFocus(ICollectionGestureTouch) |
Calculate the focus of the gesture
| |
CalculateFocus(ICollectionGestureTouch, Boolean) |
Calculate the focus of the gesture
| |
DisallowSimultaneousExecution |
Disallows the simultaneous execution with other gesture. This unlinks both gestures so this method
only needs to be called once on one of the gestures.
By default, gesures are not allowed to execute simultaneously, so you only need to call this method
if you previously allowed the gestures to execute simultaneously.
Pass null to disallow simulatneous execution with all gestures (i.e. you previously called
AllowSimultaneousExecution with a null value.
| |
DisallowSimultaneousExecutionWithAllGestures |
Disallows simultaneous execution with all gestures
| |
Dispose |
Dispose of the gesture and ensure it is removed from the global list of active gestures
| |
Distance(Single) |
Get the distance of a length, in units
| |
Distance(Single, Single) |
Gets the distance of a vector, in units
| |
DistanceBetweenPoints |
Gets the distance between two points, in units
| |
EndGestureRestart |
Restart the gesture with a set of begin touches
| |
Equals | (Inherited from Object.) | |
Finalize |
Finalizer
(Overrides ObjectFinalize.) | |
GetHashCode | (Inherited from Object.) | |
GetType | (Inherited from Object.) | |
IgnoreTouch |
Ignore a touch until it is released
| |
MemberwiseClone | (Inherited from Object.) | |
NumberOfGesturesInProgress |
The global total number of gestures in progress
| |
PointsAreWithinDistance |
Determines whether two points are within a specified distance
| |
ProcessTouchesBegan |
Call with the touches that began
| |
ProcessTouchesCancelled |
Process cancelled touches
| |
ProcessTouchesEnded |
Call with the touches that ended
| |
ProcessTouchesMoved |
Call with the touches that moved
| |
RemoveRequiredGestureRecognizerToFail |
Remove a gesture needing to fail in order for this gesture to end
| |
Reset |
Reset all internal state for the gesture recognizer
| |
RunActionAfterDelay |
Run an action on the main thread after a delay
| |
SetState |
Sets the state of the gesture. Continous gestures should set the executing state every time they change.
| |
Simulate |
Simulate a gesture
| |
StateChanged |
Called when state changes
| |
ToString |
ToString
(Overrides ObjectToString.) | |
TouchesBegan |
Call with the touches that began, child class should override
| |
TouchesEnded |
Call with the touches that ended, child class should override
| |
TouchesMoved |
Call with the touches that moved, child class should override
| |
TrackCurrentTrackedTouchesStartLocations |
Track all touches in CurrentTrackedTouches start locations
| |
TrackTouches |
Begin tracking the specified touch ids
|
Name | Description | |
---|---|---|
StateUpdated |
Fires when state is updated, use this instead of Updated, which has been deprecated.
The gesture object has a CurrentTrackedTouches property where you can access the current touches.
| |
Updated | Obsolete.
Executes when the gesture changes
|
Name | Description | |
---|---|---|
MainThreadCallback |
Main thread callback implementation
|
Name | Description | |
---|---|---|
Log |
Log
(Defined by GestureLogger.) |