Class Touch
Definition
- Assembly:
- Tizen.NUI.dll
Touch events are a collection of points at a specific moment in time.
When a multi-touch event occurs, each point represents the points that are currently being
touched or the points where a touch has stopped.
public class Touch : BaseHandle, INotifyPropertyChanged, IDisposable
- Inheritance
- Implements
-
System.ComponentModel.INotifyPropertyChangedSystem.IDisposable
Constructors
View SourceTouch()
An uninitialized touch instance.
Calling member functions with an uninitialized touch handle is not allowed.
Declaration
public Touch()
Methods
View SourceGetDeviceId(uint)
Returns the ID of the device used for the point specified.
Each point has a unique device ID, which specifies the device used for that
point. This is returned by this method.
If a point is greater than GetPointCount(), then this method will return -1.
Declaration
public int GetDeviceId(uint point)
Parameters
Type | Name | Description |
---|---|---|
uint | point | The point required. |
Returns
Type | Description |
---|---|
int | The device ID of this point. |
GetEllipseRadius(uint)
Retrieves both the horizontal and the vertical radii of the press point.
If a point is greater than GetPointCount(), then this method will return Vector2.Zero.
Declaration
public Vector2 GetEllipseRadius(uint point)
Parameters
Type | Name | Description |
---|---|---|
uint | point | The point required. |
Returns
Type | Description |
---|---|
Vector2 | The horizontal and vertical radii of the press point. |
GetHitView(uint)
Retrieves the actor that was underneath the point specified.
If a point is greater than GetPointCount(), then this method will return an empty handle.
Declaration
public View GetHitView(uint point)
Parameters
Type | Name | Description |
---|---|---|
uint | point | The point required. |
Returns
Type | Description |
---|---|
View | The actor that was underneath the point specified. |
GetLocalPosition(uint)
Retrieves the coordinates relative to the top-left of the hit actor at the point specified.
The top-left of an actor is (0.0, 0.0, 0.5).
If you require the local coordinates of another actor (for example, the parent of the hit actor),
then you should use Actor::ScreenToLocal().
If a point is greater than GetPointCount(), then this method will return Vector2.Zero.
Declaration
public Vector2 GetLocalPosition(uint point)
Parameters
Type | Name | Description |
---|---|---|
uint | point | The point required. |
Returns
Type | Description |
---|---|
Vector2 | The coordinates relative to the top-left of the hit actor of the point specified. |
GetPointCount()
Returns the total number of points in this TouchData.
Declaration
public uint GetPointCount()
Returns
Type | Description |
---|---|
uint | The total number of points. |
GetPressure(uint)
Retrieves the touch pressure.
The pressure range starts at 0.0f.
Normal pressure is defined as 1.0f.
A value between 0.0f and 1.0f means light pressure has been applied.
A value greater than 1.0f means more pressure than normal has been applied.
If point is greater than GetPointCount(), then this method will return 1.0f.
Declaration
public float GetPressure(uint point)
Parameters
Type | Name | Description |
---|---|---|
uint | point | The point required. |
Returns
Type | Description |
---|---|
float | The touch pressure. |
GetRadius(uint)
Retrieves the radius of the press point.
This is the average of both the horizontal and vertical radii of the press point.
If point is greater than GetPointCount(), then this method will return 0.0f.
Declaration
public float GetRadius(uint point)
Parameters
Type | Name | Description |
---|---|---|
uint | point | The point required. |
Returns
Type | Description |
---|---|
float | The radius of the press point. |
GetScreenPosition(uint)
Retrieves the coordinates relative to the top-left of the screen of the point specified.
If a point is greater than GetPointCount(), then this method will return Vector2.Zero.
Declaration
public Vector2 GetScreenPosition(uint point)
Parameters
Type | Name | Description |
---|---|---|
uint | point | The point required. |
Returns
Type | Description |
---|---|
Vector2 | The coordinates relative to the top-left of the screen of the point specified. |
GetState(uint)
Retrieves the state of the point specified.
If a point is greater than GetPointCount(), then this method will return PointState.Finished.
Declaration
public PointStateType GetState(uint point)
Parameters
Type | Name | Description |
---|---|---|
uint | point | The point required. |
Returns
Type | Description |
---|---|
PointStateType | The state of the point specified. |
GetTime()
Returns the time (in ms) that the touch event occurred.
Declaration
public uint GetTime()
Returns
Type | Description |
---|---|
uint | The time (in ms) that the touch event occurred. |