Cocos Creator API

1.4.x

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

inputManager

Module: cc

This class manages all events of input. include: touch, mouse, accelerometer, keyboard

Methods

handleTouchesBegin
(
  • touches
)

name type description
touches Array

handleTouchesMove
(
  • touches
)

name type description
touches Array

handleTouchesEnd
(
  • touches
)

name type description
touches Array

handleTouchesCancel
(
  • touches
)

name type description
touches Array

getSetOfTouchesEndOrCancel
(
  • touches
)
Array

name type description
touches Array

returns:

type: Array

getHTMLElementPosition
(
  • element
)
Object

name type description
element HTMLElement

returns:

type: Object

getPreTouch
(
  • touch
)
Touch

name type description
touch Touch

returns:

type: Touch

setPreTouch
(
  • touch
)

name type description
touch Touch

getTouchByXY
(
  • tx
  • ty
  • pos
)
Touch

name type description
tx Number