Click or drag to resize

ImageGestureRecognizer Class

Attempts to create an image out of the gesture and compare with a set of images
Inheritance Hierarchy

Namespace:  DigitalRubyShared
Assembly:  Assembly-CSharp (in Assembly-CSharp.dll) Version: 0.0.0.0
Syntax
C#
public class ImageGestureRecognizer : GestureRecognizer

The ImageGestureRecognizer type exposes the following members.

Constructors
  NameDescription
Public methodImageGestureRecognizer
Constructor
Top
Properties
  NameDescription
Public propertyAllowSimultaneousExecutionIfPlatformSpecificViewsAreDifferent
Allows simultaneous execution if the platform specific views do no match. Default is true.
(Inherited from GestureRecognizer.)
Public propertyClearTrackedTouchesOnEndOrFail
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.
(Inherited from GestureRecognizer.)
Public propertyCurrentTrackedTouches
The current tracked touches for the gesture
(Inherited from GestureRecognizer.)
Public propertyCustomData
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
(Inherited from GestureRecognizer.)
Public propertyDeltaX
Change in focus x in pixels
(Inherited from GestureRecognizer.)
Public propertyDeltaY
Change in focus y in pixels
(Inherited from GestureRecognizer.)
Public propertyDirectionTolerance
The amount that the path must change direction (in radians) to count as a new direction (0.39 is 1.8 of PI). Default is 0.3.
Public propertyDistanceX
The distance (in pixels) the gesture focus has moved from where it started along the x axis
(Inherited from GestureRecognizer.)
Public propertyDistanceY
The distance (in pixels) the gesture focus has moved from where it started along the y axis
(Inherited from GestureRecognizer.)
Public propertyEnabled
Whether the gesture is Enabled. Default is true.
(Inherited from GestureRecognizer.)
Public propertyFocusX
Focus x value in pixels (average of all touches)
(Inherited from GestureRecognizer.)
Public propertyFocusY
Focus y value in pixels (average of all touches)
(Inherited from GestureRecognizer.)
Public propertyGestureImages
The images that should be compared against to find a match
Public propertyImage
Calculated image from the gesture
Public propertyIsRestarting
True if gesture is in process of restarting, false otherwise
(Inherited from GestureRecognizer.)
Public propertyMatchedGestureCalculationTimeMilliseconds
The last time (in milliseconds) that was needed to calculate the matched gesture
Public propertyMatchedGestureImage
The matched gesture image or null if no match
Public propertyMaximumNumberOfTouchesToTrack
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.
(Inherited from GestureRecognizer.)
Public propertyMaximumPathCount
The maximum number of distinct paths for each image. Gesture will reset when max path count is hit. The default is 1.
Public propertyMinimumDistanceBetweenPointsUnits
Minimum difference beteen points in units to count as a new point. Default is 0.1.
Public propertyMinimumNumberOfTouchesToTrack
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.
(Inherited from GestureRecognizer.)
Public propertyMinimumPointsToRecognize
The minimum number of points before the gesture will recognize - default is 2
Public propertyPathCount
The current number of distinct paths that have been drawn
Public propertyPlatformSpecificView
A platform specific view object that this gesture can execute in, null if none
(Inherited from GestureRecognizer.)
Public propertyPlatformSpecificViewScale
The platform specific view scale (default is 1.0). Change this if the view this gesture is attached to is being scaled.
(Inherited from GestureRecognizer.)
Public propertyPressure
Average pressure of all tracked touches
(Inherited from GestureRecognizer.)
Protected propertyPrevFocusX
Previous focus x
(Inherited from GestureRecognizer.)
Protected propertyPrevFocusY
Previous focus y
(Inherited from GestureRecognizer.)
Public propertyReceivedAdditionalTouches
Whether additional touches were added to the gesture since the last execute state.
(Inherited from GestureRecognizer.)
Public propertyRequireGestureRecognizersToFail
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.
(Inherited from GestureRecognizer.)
Public propertyRequireGestureRecognizerToFail
Convenience method to add / remove one gesture to require failure on. Set to null to clear all require gestures to fail.
(Inherited from GestureRecognizer.)
Public propertyResetOnEnd
This gesture does not reset on end like most gestures - you must reset it manually when you get the image out of it you want
(Overrides GestureRecognizerResetOnEnd.)
Public propertySimilarityMinimum
The amount that the gesture image must match an image from the set to count as a match (0 - 1). Default is 0.8.
Public propertySpeed
The speed of the gesture in pixels using focus
(Inherited from GestureRecognizer.)
Public propertyStartFocusX
Start focus x value in pixels (average of all touches)
(Inherited from GestureRecognizer.)
Public propertyStartFocusY
Start focus y value in pixels (average of all touches)
(Inherited from GestureRecognizer.)
Public propertyState
Get the current gesture recognizer state
(Inherited from GestureRecognizer.)
Public propertyThresholdUnits
The distance in units that the touch must move before the gesture begins - default is 0.4
Public propertyTrackedTouchCountIsWithinRange
Whether the current number of tracked touches is within the min and max number of touches to track
(Inherited from GestureRecognizer.)
Public propertyVelocityX
Velocity x in pixels using focus
(Inherited from GestureRecognizer.)
Public propertyVelocityY
Velocity y in pixels using focus
(Inherited from GestureRecognizer.)
Top
Methods
  NameDescription
Public methodAddRequiredGestureRecognizerToFail
Require a gesture to fail in order for this gesture to end
(Inherited from GestureRecognizer.)
Public methodAllowSimultaneousExecution
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.
(Inherited from GestureRecognizer.)
Public methodAllowSimultaneousExecutionWithAllGestures
Allows simultaneous execution with all gestures
(Inherited from GestureRecognizer.)
Protected methodAreTrackedTouchesWithinDistance
Determines whether any tracked touches are within the distance of the starting point of each tracked touch.
(Inherited from GestureRecognizer.)
Public methodBeginGestureRestart
Allows the gesture to restart even if the touches are not lifted. This is only valid when called from the "Ended" state.
(Inherited from GestureRecognizer.)
Protected methodCalculateFocus(ICollectionGestureTouch)
Calculate the focus of the gesture
(Inherited from GestureRecognizer.)
Protected methodCalculateFocus(ICollectionGestureTouch, Boolean)
Calculate the focus of the gesture
(Inherited from GestureRecognizer.)
Public methodDisallowSimultaneousExecution
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.
(Inherited from GestureRecognizer.)
Public methodDisallowSimultaneousExecutionWithAllGestures
Disallows simultaneous execution with all gestures
(Inherited from GestureRecognizer.)
Public methodDispose
Dispose of the gesture and ensure it is removed from the global list of active gestures
(Inherited from GestureRecognizer.)
Public methodDistance(Single)
Get the distance of a length, in units
(Inherited from GestureRecognizer.)
Public methodDistance(Single, Single)
Gets the distance of a vector, in units
(Inherited from GestureRecognizer.)
Public methodDistanceBetweenPoints
Gets the distance between two points, in units
(Inherited from GestureRecognizer.)
Public methodEndGestureRestart
Restart the gesture with a set of begin touches
(Inherited from GestureRecognizer.)
Public methodEquals (Inherited from Object.)
Protected methodFinalize
Finalizer
(Inherited from GestureRecognizer.)
Public methodGetHashCode (Inherited from Object.)
Public methodGetType (Inherited from Object.)
Protected methodIgnoreTouch
Ignore a touch until it is released
(Inherited from GestureRecognizer.)
Protected methodMemberwiseClone (Inherited from Object.)
Public methodPointsAreWithinDistance
Determines whether two points are within a specified distance
(Inherited from GestureRecognizer.)
Public methodProcessTouchesBegan
Call with the touches that began
(Inherited from GestureRecognizer.)
Public methodProcessTouchesCancelled
Process cancelled touches
(Inherited from GestureRecognizer.)
Public methodProcessTouchesEnded
Call with the touches that ended
(Inherited from GestureRecognizer.)
Public methodProcessTouchesMoved
Call with the touches that moved
(Inherited from GestureRecognizer.)
Public methodRemoveRequiredGestureRecognizerToFail
Remove a gesture needing to fail in order for this gesture to end
(Inherited from GestureRecognizer.)
Public methodReset
Reset the image gesture recognizer
(Overrides GestureRecognizerReset.)
Protected methodSetState
Sets the state of the gesture. Continous gestures should set the executing state every time they change.
(Inherited from GestureRecognizer.)
Public methodSimulate
Simulate a gesture
(Inherited from GestureRecognizer.)
Protected methodStateChanged
Called when state changes
(Inherited from GestureRecognizer.)
Public methodToString
ToString
(Inherited from GestureRecognizer.)
Protected methodTouchesBegan
TouchesBegan
(Overrides GestureRecognizerTouchesBegan(IEnumerableGestureTouch).)
Protected methodTouchesEnded
TouchesEnded
(Overrides GestureRecognizerTouchesEnded.)
Protected methodTouchesMoved
TouchesMoved
(Overrides GestureRecognizerTouchesMoved.)
Protected methodTrackCurrentTrackedTouchesStartLocations
Track all touches in CurrentTrackedTouches start locations
(Inherited from GestureRecognizer.)
Protected methodTrackTouches
Begin tracking the specified touch ids
(Inherited from GestureRecognizer.)
Top
Events
  NameDescription
Public eventMaximumPathCountExceeded
Fires when the maximum path count is exceeded
Public eventStateUpdated
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.
(Inherited from GestureRecognizer.)
Public eventUpdated Obsolete.
Executes when the gesture changes
(Inherited from GestureRecognizer.)
Top
Fields
  NameDescription
Public fieldStatic memberImageColumns
Number of columns in the images for gestures. For square images (recommended) set to ImageRows.
Public fieldStatic memberImageRows
Number of image rows. Should be greater than 4 and less than 65.
Public fieldStatic memberImageSize
Number of elements in the images for gestures.
Public fieldStatic memberLinePadding
The padding for each pixel converted from lines to the pixel image. Supported values are 0, 1 and 2.
Public fieldStatic memberRowBitmask
Current row bit mask
Public fieldStatic memberRowBitMasks
Masks to shave off exlusive or'd bits that we don't want to include in a row
Top
Extension Methods
  NameDescription
Public Extension MethodLog
Log
(Defined by GestureLogger.)
Top
See Also