cocos2d-x  3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Touch Class Reference

Encapsulates the Touch information, such as touch point, id and so on, and provides the methods that commonly used. More...

#include <CCTouch.h>

Inheritance diagram for Touch:
Ref

Public Types

enum  DispatchMode { ALL_AT_ONCE, ONE_BY_ONE }
 Dispatch mode, how the touches are dispathced. More...
 

Public Member Functions

 Touch ()
 Constructor. More...
 
 ctor ()
 Constructor. More...
 
 Touch ()
 Constructor. More...
 
Vec2 getLocation () const
 Returns the current touch location in OpenGL coordinates. More...
 
var getLocation ()
 Returns the current touch location in OpenGL coordinates. More...
 
local getLocation ()
 Returns the current touch location in OpenGL coordinates. More...
 
Vec2 getPreviousLocation () const
 Returns the previous touch location in OpenGL coordinates. More...
 
var getPreviousLocation ()
 Returns the previous touch location in OpenGL coordinates. More...
 
local getPreviousLocation ()
 Returns the previous touch location in OpenGL coordinates. More...
 
Vec2 getStartLocation () const
 Returns the start touch location in OpenGL coordinates. More...
 
var getStartLocation ()
 Returns the start touch location in OpenGL coordinates. More...
 
local getStartLocation ()
 Returns the start touch location in OpenGL coordinates. More...
 
Vec2 getDelta () const
 Returns the delta of 2 current touches locations in screen coordinates. More...
 
Vec2 getLocationInView () const
 Returns the current touch location in screen coordinates. More...
 
Vec2 getPreviousLocationInView () const
 Returns the previous touch location in screen coordinates. More...
 
var getPreviousLocationInView ()
 Returns the previous touch location in screen coordinates. More...
 
local getPreviousLocationInView ()
 Returns the previous touch location in screen coordinates. More...
 
Vec2 getStartLocationInView () const
 Returns the start touch location in screen coordinates. More...
 
var getStartLocationInView ()
 Returns the start touch location in screen coordinates. More...
 
local getStartLocationInView ()
 Returns the start touch location in screen coordinates. More...
 
void setTouchInfo (int id, float x, float y)
 Set the touch infomation. More...
 
int getID () const
 Get touch id. More...
 
- Public Member Functions inherited from Ref
void retain ()
 Retains the ownership. More...
 
void release ()
 Releases the ownership immediately. More...
 
Refautorelease ()
 Releases the ownership sometime soon automatically. More...
 
unsigned int getReferenceCount () const
 Returns the Ref's current reference count. More...
 
virtual ~Ref ()
 Destructor. More...
 

Additional Inherited Members

- Protected Member Functions inherited from Ref
 Ref ()
 Constructor. More...
 
 Ref ()
 Constructor. More...
 
- Protected Attributes inherited from Ref
unsigned int _referenceCount
 count of references More...
 
local _referenceCount
 count of references More...
 

Detailed Description

Encapsulates the Touch information, such as touch point, id and so on, and provides the methods that commonly used.

Constructor & Destructor Documentation

Touch ( )
inline

Constructor.

var ctor ( )
inline

Constructor.

local Touch ( )
inline

Constructor.

Member Function Documentation

Vec2 getDelta ( ) const

Returns the delta of 2 current touches locations in screen coordinates.

Returns
The delta of 2 current touches locations in screen coordinates.
var getDelta ( )

Returns the delta of 2 current touches locations in screen coordinates.

Returns
The delta of 2 current touches locations in screen coordinates.
local getDelta ( )

Returns the delta of 2 current touches locations in screen coordinates.

Returns
The delta of 2 current touches locations in screen coordinates.
int getID ( ) const
inline

Get touch id.

@

var getId ( )
inline

Get touch id.

@

local getId ( )
inline

Get touch id.

@

Vec2 getLocation ( ) const

Returns the current touch location in OpenGL coordinates.

Returns
The current touch location in OpenGL coordinates.
var getLocation ( )

Returns the current touch location in OpenGL coordinates.

Returns
The current touch location in OpenGL coordinates.
local getLocation ( )

Returns the current touch location in OpenGL coordinates.

Returns
The current touch location in OpenGL coordinates.
Vec2 getLocationInView ( ) const

Returns the current touch location in screen coordinates.

Returns
The current touch location in screen coordinates.
var getLocationInView ( )

Returns the current touch location in screen coordinates.

Returns
The current touch location in screen coordinates.
local getLocationInView ( )

Returns the current touch location in screen coordinates.

Returns
The current touch location in screen coordinates.
Vec2 getPreviousLocation ( ) const

Returns the previous touch location in OpenGL coordinates.

Returns
The previous touch location in OpenGL coordinates.
var getPreviousLocation ( )

Returns the previous touch location in OpenGL coordinates.

Returns
The previous touch location in OpenGL coordinates.
local getPreviousLocation ( )

Returns the previous touch location in OpenGL coordinates.

Returns
The previous touch location in OpenGL coordinates.
Vec2 getPreviousLocationInView ( ) const

Returns the previous touch location in screen coordinates.

Returns
The previous touch location in screen coordinates.
var getPreviousLocationInView ( )

Returns the previous touch location in screen coordinates.

Returns
The previous touch location in screen coordinates.
local getPreviousLocationInView ( )

Returns the previous touch location in screen coordinates.

Returns
The previous touch location in screen coordinates.
Vec2 getStartLocation ( ) const

Returns the start touch location in OpenGL coordinates.

Returns
The start touch location in OpenGL coordinates.
var getStartLocation ( )

Returns the start touch location in OpenGL coordinates.

Returns
The start touch location in OpenGL coordinates.
local getStartLocation ( )

Returns the start touch location in OpenGL coordinates.

Returns
The start touch location in OpenGL coordinates.
Vec2 getStartLocationInView ( ) const

Returns the start touch location in screen coordinates.

Returns
The start touch location in screen coordinates.
var getStartLocationInView ( )

Returns the start touch location in screen coordinates.

Returns
The start touch location in screen coordinates.
local getStartLocationInView ( )

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 infomation.

It always used to monitor touch event.

Parameters
idA given id
xA given x coordinate.
yA given y coordinate.
var setTouchInfo ( var  id,
var  x,
var  y 
)
inline

Set the touch infomation.

It always used to monitor touch event.

Parameters
idA given id
xA given x coordinate.
yA given y coordinate.
local setTouchInfo ( local  id,
local  x,
local  y 
)
inline

Set the touch infomation.

It always used to monitor touch event.

Parameters
idA given id
xA given x coordinate.
yA given y coordinate.

The documentation for this class was generated from the following file: