Touch Class
Module: cc
The touch event class
Index
Methods
- getLocationReturns the current touch location in OpenGL coordinates.、
- getLocationXReturns X axis location value.
- getLocationYReturns Y axis location value.
- getPreviousLocationReturns the previous touch location in OpenGL coordinates.
- getStartLocationReturns the start touch location in OpenGL coordinates.
- getDeltaReturns the delta distance from the previous touche to the current one in screen coordinates.
- getLocationInViewReturns the current touch location in screen coordinates.
- getPreviousLocationInViewReturns the previous touch location in screen coordinates.
- getStartLocationInViewReturns the start touch location in screen coordinates.
- getIDReturns the id of cc.Touch.
- setTouchInfoSets information to touch.
Details
Methods
getLocation
Returns the current touch location in OpenGL coordinates.、
| meta | description | 
|---|---|
| Returns | Vec2 | 
| Defined in | https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/event-manager/CCTouch.js:45 | 
getLocationX
Returns X axis location value.
| meta | description | 
|---|---|
| Returns | Number | 
| Defined in | https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/event-manager/CCTouch.js:57 | 
getLocationY
Returns Y axis location value.
| meta | description | 
|---|---|
| Returns | Number | 
| Defined in | https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/event-manager/CCTouch.js:67 | 
getPreviousLocation
Returns the previous touch location in OpenGL coordinates.
| meta | description | 
|---|---|
| Returns | Vec2 | 
| Defined in | https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/event-manager/CCTouch.js:77 | 
getStartLocation
Returns the start touch location in OpenGL coordinates.
| meta | description | 
|---|---|
| Returns | Vec2 | 
| Defined in | https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/event-manager/CCTouch.js:89 | 
getDelta
Returns the delta distance from the previous touche to the current one in screen coordinates.
| meta | description | 
|---|---|
| Returns | Vec2 | 
| Defined in | https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/event-manager/CCTouch.js:101 | 
getLocationInView
Returns the current touch location in screen coordinates.
| meta | description | 
|---|---|
| Returns | Vec2 | 
| Defined in | https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/event-manager/CCTouch.js:111 | 
getPreviousLocationInView
Returns the previous touch location in screen coordinates.
| meta | description | 
|---|---|
| Returns | Vec2 | 
| Defined in | https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/event-manager/CCTouch.js:121 | 
getStartLocationInView
Returns the start touch location in screen coordinates.
| meta | description | 
|---|---|
| Returns | Vec2 | 
| Defined in | https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/event-manager/CCTouch.js:131 | 
getID
Returns the id of cc.Touch.
| meta | description | 
|---|---|
| Returns | Number | 
| Defined in | https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/event-manager/CCTouch.js:141 | 
setTouchInfo
Sets information to touch.
| meta | description | 
|---|---|
| Defined in | https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/event-manager/CCTouch.js:151 | 
