Struct TouchLocation
Provides methods and properties for interacting with a touch location on a touch screen device.
public struct TouchLocation : IEquatable<TouchLocation>
- Implements
- Inherited Members
Constructors
TouchLocation(int, TouchLocationState, Vector2)
Initializes a new instance of the TouchLocation structure.
public TouchLocation(int id, TouchLocationState state, Vector2 position)
Parameters
idintID of the touch location.
stateTouchLocationStateCurrent state of the touch location.
positionVector2Position of the touch location.
TouchLocation(int, TouchLocationState, Vector2, TouchLocationState, Vector2)
Initializes a new instance of the TouchLocation structure.
public TouchLocation(int id, TouchLocationState state, Vector2 position, TouchLocationState previousState, Vector2 previousPosition)
Parameters
idintID of the touch location.
stateTouchLocationStateCurrent state of the touch location.
positionVector2Position of the touch location.
previousStateTouchLocationStatePrevious state of this touch location.
previousPositionVector2Previous position of this touch location.
Properties
Id
Gets the ID of the touch location.
public int Id { get; }
Property Value
Position
Gets the position of the touch location.
public Vector2 Position { get; }
Property Value
Pressure
Gets the pressure of the touch location.
public float Pressure { get; }
Property Value
Remarks
Only used in Android devices
State
Gets the current state of the touch location.
public TouchLocationState State { get; }
Property Value
Methods
Equals(TouchLocation)
public bool Equals(TouchLocation other)
Parameters
otherTouchLocation
Returns
Equals(object)
public override bool Equals(object obj)
Parameters
objobject
Returns
GetHashCode()
public override int GetHashCode()
Returns
IsHighFrequencyEvent()
Returns true if the touch panel is configured to process high frequence touch events.
public bool IsHighFrequencyEvent()
Returns
ToString()
Gets a string representation of the TouchLocation.
public override string ToString()
Returns
TryGetPreviousLocation(out TouchLocation)
Attempts to get the previous location of this touch location object.
public bool TryGetPreviousLocation(out TouchLocation aPreviousLocation)
Parameters
aPreviousLocationTouchLocationPrevious location data, as a TouchLocation.
Returns
Operators
operator ==(TouchLocation, TouchLocation)
Returns a value that indicates whether the two values are equal.
public static bool operator ==(TouchLocation value1, TouchLocation value2)
Parameters
value1TouchLocationThe value on the left of the equality operator.
value2TouchLocationThe value on the right of the equality operator.
Returns
operator !=(TouchLocation, TouchLocation)
Returns a value that indicates whether the two values are not equal.
public static bool operator !=(TouchLocation value1, TouchLocation value2)
Parameters
value1TouchLocationThe value on the left of the inequality operator.
value2TouchLocationThe value on the right of the inequality operator.