Encapsulates the Touch information, such as touch point, id and so on, and provides the methods that commonly used.
More...
Inherits Ref.
|
| Touch () |
| Constructor.
|
|
Vec2 | getLocation () const |
| Returns the current touch location in OpenGL coordinates.
|
|
Vec2 | getPreviousLocation () const |
| Returns the previous touch location in OpenGL coordinates.
|
|
Vec2 | getStartLocation () const |
| Returns the start touch location in OpenGL coordinates.
|
|
Vec2 | getDelta () const |
| Returns the delta of 2 current touches locations in screen coordinates.
|
|
Vec2 | getLocationInView () const |
| Returns the current touch location in screen coordinates.
|
|
Vec2 | getPreviousLocationInView () const |
| Returns the previous touch location in screen coordinates.
|
|
Vec2 | getStartLocationInView () const |
| Returns the start touch location in screen coordinates.
|
|
void | setTouchInfo (int id, float x, float y) |
| Set the touch information.
|
|
void | setTouchInfo (int id, float x, float y, float force, float maxForce) |
| Set the touch information.
|
|
int | getID () const |
| Get touch id.
|
|
float | getCurrentForce () const |
| Returns the current touch force for 3d touch.
|
|
float | getMaxForce () const |
| Returns the maximum touch force for 3d touch.
|
|
void | retain () |
| Retains the ownership.
|
|
void | release () |
| Releases the ownership immediately.
|
|
Ref * | autorelease () |
| Releases the ownership sometime soon automatically.
|
|
unsigned int | getReferenceCount () const |
| Returns the Ref's current reference count.
|
|
virtual | ~Ref () |
| Destructor.
|
|
|
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.
Dispatch mode, how the touches are dispatched.
NA
Enumerator |
---|
ONE_BY_ONE |
All at once.
|
Vec2 getLocation |
( |
| ) |
const |
Returns the current touch location in OpenGL coordinates.
- Returns
- The current touch location in OpenGL coordinates.
Vec2 getPreviousLocation |
( |
| ) |
const |
Returns the previous touch location in OpenGL coordinates.
- Returns
- The previous touch location in OpenGL coordinates.
Vec2 getStartLocation |
( |
| ) |
const |
Returns the start touch location in OpenGL coordinates.
- Returns
- The start touch location in OpenGL coordinates.
Returns the delta of 2 current touches locations in screen coordinates.
- Returns
- The delta of 2 current touches locations in screen coordinates.
Vec2 getLocationInView |
( |
| ) |
const |
Returns the current touch location in screen coordinates.
- Returns
- The current touch location in screen coordinates.
Vec2 getPreviousLocationInView |
( |
| ) |
const |
Returns the previous touch location in screen coordinates.
- Returns
- The previous touch location in screen coordinates.
Vec2 getStartLocationInView |
( |
| ) |
const |
Returns the start touch location in screen coordinates.
- Returns
- The start touch location in screen coordinates.
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. |
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. |
Get touch id.
getId getId
- Returns
- The id of touch.
float getCurrentForce |
( |
| ) |
const |
Returns the current touch force for 3d touch.
- Returns
- The current touch force for 3d touch.
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: