Cocos Creator API

1.0.0

Cocos Creator is a highly customizable game development tool that utilizes the power of cocos2d-x.

Touch

Module: cc

The touch event class

Methods

getLocation ( ) Vec2

Returns the current touch location in OpenGL coordinates.、

returns:

type: Vec2

getLocationX ( ) Number

Returns X axis location value.

returns:

type: Number

getLocationY ( ) Number

Returns Y axis location value.

returns:

type: Number

getPreviousLocation ( ) Vec2

Returns the previous touch location in OpenGL coordinates.

returns:

type: Vec2

getStartLocation ( ) Vec2

Returns the start touch location in OpenGL coordinates.

returns:

type: Vec2

getDelta ( ) Vec2

Returns the delta distance from the previous touche to the current one in screen coordinates.

returns:

type: Vec2

getLocationInView ( ) Vec2

Returns the current touch location in screen coordinates.

returns:

type: Vec2

getPreviousLocationInView ( ) Vec2

Returns the previous touch location in screen coordinates.

returns:

type: Vec2

getStartLocationInView ( ) Vec2

Returns the start touch location in screen coordinates.

returns:

type: Vec2

getID ( ) Number

Returns the id of cc.Touch.

returns:

type: Number

setTouchInfo
(
  • id
  • x
  • y
)

Sets information to touch.

name type description
id Number
x Number
y Number

There are no methods that match your current filter settings. You can change your filter settings in the index section on this page. index