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)

_mouseDownItem Container

(No description yet)

_mouseDownTime Number

(No description yet)

_mouseMoveItem Container

(No description yet)

_mouseUpItem Container

(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 current touch identifiers.

Methods

_calculateXY(event)

(No description yet)

Parameters:

  • event MouseEvent|TouchEvent
_devicemotion(event)

(No description yet)

Parameters:

  • event DeviceMotionEvent
_hitTest(container, x, y) Boolean

(No description yet)

Parameters:

  • container Container
  • x Number
  • y Number
_mousedown(event)

(No description yet)

Parameters:

  • event MouseEvent|TouchEvent
_mousemove(event)

(No description yet)

Parameters:

  • event MouseEvent|TouchEvent
_mouseout(event)

(No description yet)

Parameters:

  • event MouseEvent|TouchEvent
_mouseup(event)

(No description yet)

Parameters:

  • event MouseEvent|TouchEvent
_preventDefault(event)

(No description yet)

Parameters:

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

(No description yet)

Parameters:

  • eventName String
  • event MouseEvent|TouchEvent

item

_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.