Encapsulates the Touch information, such as touch point, id and so on, and provides the methods that commonly used.
More...
Inherits Ref.
|
|
unsigned int | _ID |
| | object id, ScriptSupport need public _ID
|
| |
|
int | _luaID |
| | Lua reference id.
|
| |
|
void * | _scriptObject |
| | scriptObject, support for swift
|
| |
|
bool | _rooted |
| | When true, it means that the object was already rooted.
|
| |
Encapsulates the Touch information, such as touch point, id and so on, and provides the methods that commonly used.
◆ DispatchMode
Dispatch mode, how the touches are dispatched.
@js NA
| Enumerator |
|---|
| ONE_BY_ONE | All at once.
|
◆ Touch()
◆ getLocation()
| Vec2 getLocation |
( |
| ) |
const |
Returns the current touch location in OpenGL coordinates.
- Returns
- The current touch location in OpenGL coordinates.
◆ getPreviousLocation()
| Vec2 getPreviousLocation |
( |
| ) |
const |
Returns the previous touch location in OpenGL coordinates.
- Returns
- The previous touch location in OpenGL coordinates.
◆ getStartLocation()
| Vec2 getStartLocation |
( |
| ) |
const |
Returns the start touch location in OpenGL coordinates.
- Returns
- The start touch location in OpenGL coordinates.
◆ getDelta()
Returns the delta of 2 current touches locations in screen coordinates.
- Returns
- The delta of 2 current touches locations in screen coordinates.
◆ getLocationInView()
| Vec2 getLocationInView |
( |
| ) |
const |
Returns the current touch location in screen coordinates.
- Returns
- The current touch location in screen coordinates.
◆ getPreviousLocationInView()
| Vec2 getPreviousLocationInView |
( |
| ) |
const |
Returns the previous touch location in screen coordinates.
- Returns
- The previous touch location in screen coordinates.
◆ getStartLocationInView()
| Vec2 getStartLocationInView |
( |
| ) |
const |
Returns the start touch location in screen coordinates.
- Returns
- The start touch location in screen coordinates.
◆ setTouchInfo() [1/2]
| void setTouchInfo |
( |
int |
id, |
|
|
float |
x, |
|
|
float |
y |
|
) |
| |
|
inline |
Set the touch information.
It always used to monitor touch event.
- Parameters
-
| id | A given id |
| x | A given x coordinate. |
| y | A given y coordinate. |
◆ setTouchInfo() [2/2]
| void setTouchInfo |
( |
int |
id, |
|
|
float |
x, |
|
|
float |
y, |
|
|
float |
force, |
|
|
float |
maxForce |
|
) |
| |
|
inline |
Set the touch information.
It always used to monitor touch event.
- Parameters
-
| id | A given id |
| x | A given x coordinate. |
| y | A given y coordinate. |
| force | Current force for 3d touch. |
| maxForce | maximum possible force for 3d touch. |
◆ getID()
Get touch id.
@js getId @lua getId
- Returns
- The id of touch.
◆ getCurrentForce()
| float getCurrentForce |
( |
| ) |
const |
Returns the current touch force for 3d touch.
- Returns
- The current touch force for 3d touch.
◆ getMaxForce()
| float getMaxForce |
( |
| ) |
const |
Returns the maximum touch force for 3d touch.
- Returns
- The maximum touch force for 3d touch.
The documentation for this class was generated from the following file: