Input

Module: engine.input

Interactivity controller. Instance automatically created at game.input

new game.Input(canvas)

Parameters:

  • canvas HTMLCanvasElement

Properties

_currentCursor String

(No description yet)

_mouseInput InputEvent

(No description yet)

_needUpdate Boolean (Default: false)

(No description yet)

items Array

List of interactive items.

motion DeviceMotionEvent

Device motion info.

mouse Vector

Mouse position.

touches Array

List of InputEvent objects for current touches.

Methods

_calculateXY(input)

(No description yet)

Parameters:

  • input InputEvent
_devicemotion(event)

(No description yet)

Parameters:

  • event DeviceMotionEvent
_getTouchById(id) Touch

(No description yet)

Parameters:

  • id Number
_hitTest(container, x, y) Boolean

(No description yet)

Parameters:

  • container Container
  • x Number
  • y Number
_inputdown(input)

(No description yet)

Parameters:

  • input InputEvent
_inputmove(input)

(No description yet)

Parameters:

  • input InputEvent
_inputup(input)

(No description yet)

Parameters:

  • input InputEvent
_mousedown(event)

(No description yet)

Parameters:

  • event MouseEvent
_mousemove(event)

(No description yet)

Parameters:

  • event MouseEvent
_mouseout(event)

(No description yet)

Parameters:

  • event MouseEvent
_mouseup(event)

(No description yet)

Parameters:

  • event MouseEvent
_preventDefault(event)

(No description yet)

Parameters:

  • event MouseEvent|TouchEvent
_processEvent(eventName, input) Object

(No description yet)

Parameters:

  • eventName String
  • input InputEvent

item

_remove()

Remove all event listeners.

_reset()

(No description yet)

_touchend(event)

(No description yet)

Parameters:

  • event TouchEvent
_touchmove(event)

(No description yet)

Parameters:

  • event TouchEvent
_touchstart(event)

(No description yet)

Parameters:

  • event TouchEvent
_update()

(No description yet)

_updateCursor()

(No description yet)

_updateItems(container)

(No description yet)

Parameters:

  • container Container

Attributes

buttonModeCursor String (Default: pointer)

Cursor to use on buttonMode.

clickTimeout Number (Default: 500)

Time after click is not called (ms).

focusOnMouseDown Boolean (Default: true)

Set focus to canvas in mousedown event.

multitouch Boolean (Default: true)

Enable multitouch.

preventDefault Boolean (Default: true)

Should mouse and touch events prevent default action.