Class cc.Touch

Class Summary
Constructor Attributes Constructor Name and Description
 
cc.Touch(x, y, id)
The touch event class

Method Summary

Class Detail

cc.Touch(x, y, id)
The touch event class
Parameters:
{Number} x
{Number} y
{Number} id

Method Detail

  • {cc.Point} getDelta()
    Returns the delta distance from the previous touche to the current one in screen coordinates
    Returns:
    {cc.Point}
  • {Number} getID()
    Returns the id of cc.Touch
    Returns:
    {Number}
  • {Number} getId()
    Returns the id of cc.Touch
    Deprecated:
    since v3.0, please use getID() instead
    Returns:
    {Number}
  • {cc.Point} getLocation()
    Returns the current touch location in OpenGL coordinates
    Returns:
    {cc.Point}
  • {cc.Point} getLocationInView()
    Returns the current touch location in screen coordinates
    Returns:
    {cc.Point}
  • {number} getLocationX()
    Returns X axis location value
    Returns:
    {number}
  • {number} getLocationY()
    Returns Y axis location value
    Returns:
    {number}
  • {cc.Point} getPreviousLocation()
    Returns the previous touch location in OpenGL coordinates
    Returns:
    {cc.Point}
  • {cc.Point} getPreviousLocationInView()
    Returns the previous touch location in screen coordinates
    Returns:
    {cc.Point}
  • {cc.Point} getStartLocation()
    Returns the start touch location in OpenGL coordinates
    Returns:
    {cc.Point}
  • {cc.Point} getStartLocationInView()
    Returns the start touch location in screen coordinates
    Returns:
    {cc.Point}
  • setTouchInfo(id, x, y)
    Sets information to touch
    Parameters:
    {Number} id
    {Number} x
    {Number} y