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)
Indicates whether the current object is equal to another object of the same type.
public bool Equals(TouchLocation other)
Parameters
otherTouchLocationAn object to compare with this object.
Returns
Equals(object)
Indicates whether this instance and a specified object are equal.
public override bool Equals(object obj)
Parameters
objobjectThe object to compare with the current instance.
Returns
- bool
true if
objand this instance are the same type and represent the same value; otherwise, false.
GetHashCode()
Returns the hash code for this instance.
public override int GetHashCode()
Returns
- int
A 32-bit signed integer that is the hash code for this instance.
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.