Class Touch
Definition
- Namespace:
- Tizen.NUI
- Assembly:
- Tizen.NUI.dll
- API Level:
- 3
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.
C#Copypublic class Touch : BaseHandle, IDynamicResourceHandler, IElement, INameScope, IElementController, System.IDisposable
- Inheritance
- Implements
Constructors
Touch()
An uninitialized touch instance.
Calling member functions with an uninitialized touch handle is not allowed.
Declaration
C#Copypublic Touch()
API Level: 3
Methods
Declaration
C#Copypublic Degree GetAngle(uint point)
Parameters
Type | Name | Description |
---|---|---|
UInt32 | point |
Returns
Type | Description |
---|---|
Degree |
GetDeviceClass(UInt32)
Gets the device class type from which the mouse/touch event is originated.
Declaration
C#Copypublic DeviceClassType GetDeviceClass(uint point)
Parameters
Type | Name | Description |
---|---|---|
UInt32 | point | The index of a touch point. |
Returns
Type | Description |
---|---|
DeviceClassType |
GetDeviceId(UInt32)
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
C#Copypublic int GetDeviceId(uint point)
Parameters
Type | Name | Description |
---|---|---|
UInt32 | point | The index of a touch point |
Returns
Type | Description |
---|---|
Int32 | The device ID of this point. |
API Level: 3
GetDeviceSubClass(UInt32)
Gets the subclass type of the device from which the mouse/touch event is originated.
Declaration
C#Copypublic DeviceSubClassType GetDeviceSubClass(uint point)
Parameters
Type | Name | Description |
---|---|---|
UInt32 | point | The index of a touch point. |
Returns
Type | Description |
---|---|
DeviceSubClassType |
GetEllipseRadius(UInt32)
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
C#Copypublic Vector2 GetEllipseRadius(uint point)
Parameters
Type | Name | Description |
---|---|---|
UInt32 | point | The index of a touch point. |
Returns
Type | Description |
---|---|
Vector2 | The horizontal and vertical radii of the press point. |
API Level: 3
GetHitView(UInt32)
Retrieves the view that was underneath the point specified.
If a point is greater than GetPointCount(), then this method will return an empty handle.
Declaration
C#Copypublic View GetHitView(uint point)
Parameters
Type | Name | Description |
---|---|---|
UInt32 | point | The index of a touch point. |
Returns
Type | Description |
---|---|
View | The view that was underneath the point specified. |
API Level: 3
GetLocalPosition(UInt32)
Retrieves the coordinates relative to the top-left of the hit view at the point specified.
The top-left of an view is (0.0, 0.0, 0.5).
If you require the local coordinates of another view (for example, the parent of the hit view),
then you should use ScreenToLocal().
If a point is greater than GetPointCount(), then this method will return Vector2.Zero.
Declaration
C#Copypublic Vector2 GetLocalPosition(uint point)
Parameters
Type | Name | Description |
---|---|---|
UInt32 | point | The index of a touch point. |
Returns
Type | Description |
---|---|
Vector2 | The coordinates relative to the top-left of the hit view of the point specified. |
API Level: 3
GetMouseButton(UInt32)
Get mouse device's button value (for example, right or left button)
Declaration
C#Copypublic MouseButton GetMouseButton(uint point)
Parameters
Type | Name | Description |
---|---|---|
UInt32 | point | The index of a touch point. |
Returns
Type | Description |
---|---|
MouseButton |
API Level: 5
GetPointCount()
Returns the total number of points in this TouchData. Point means the touched point. If there is one touch point, the point index is 0. If there are two touch points, the point index has 0 and 1.
Declaration
C#Copypublic uint GetPointCount()
Returns
Type | Description |
---|---|
UInt32 | The total number of points. |
API Level: 3
GetPressure(UInt32)
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
C#Copypublic float GetPressure(uint point)
Parameters
Type | Name | Description |
---|---|---|
UInt32 | point | The index of a touch point. |
Returns
Type | Description |
---|---|
Single | The touch pressure. |
API Level: 3
GetRadius(UInt32)
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
C#Copypublic float GetRadius(uint point)
Parameters
Type | Name | Description |
---|---|---|
UInt32 | point | The index of a touch point. |
Returns
Type | Description |
---|---|
Single | The radius of the press point. |
API Level: 3
GetScreenPosition(UInt32)
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
C#Copypublic Vector2 GetScreenPosition(uint point)
Parameters
Type | Name | Description |
---|---|---|
UInt32 | point | The index of a touch point. |
Returns
Type | Description |
---|---|
Vector2 | The coordinates relative to the top-left of the screen of the point specified. |
API Level: 3
GetState(UInt32)
Retrieves the state of the point specified.
If a point is greater than GetPointCount(), then this method will return PointState.Finished.
Declaration
C#Copypublic PointStateType GetState(uint point)
Parameters
Type | Name | Description |
---|---|---|
UInt32 | point | The index of a touch point. |
Returns
Type | Description |
---|---|
PointStateType | The state of the point specified. |
API Level: 3
Declaration
C#Copypublic uint GetTime()
Returns
Type | Description |
---|---|
UInt32 | The time (in ms) that the touch event occurred. |
API Level: 3
Declaration
C#Copyprotected override void ReleaseSwigCPtr(Runtime.InteropServices.HandleRef swigCPtr)
Parameters
Type | Name | Description |
---|---|---|
Tizen.System.Runtime.InteropServices.HandleRef | swigCPtr |