Class: SmoothedKeyControl

Phaser.Cameras.Controls. SmoothedKeyControl

[description]


new SmoothedKeyControl(config)

Parameters:
Name Type Description
config SmoothedKeyControlConfig

[description]

Since: 3.0.0
Source: src/cameras/controls/SmoothedKeyControl.js (Line 39)

Members


accelX :number

The horizontal acceleration the camera will move.

Type:
  • number
Since: 3.0.0
Default Value:
  • 0
Source: src/cameras/controls/SmoothedKeyControl.js (Line 136)

accelY :number

The vertical acceleration the camera will move.

Type:
  • number
Since: 3.0.0
Default Value:
  • 0
Source: src/cameras/controls/SmoothedKeyControl.js (Line 146)

active :boolean

A flag controlling if the Controls will update the Camera or not.

Type:
  • boolean
Since: 3.0.0
Source: src/cameras/controls/SmoothedKeyControl.js (Line 268)

<nullable> camera :Phaser.Cameras.Scene2D.Camera

The Camera that this Control will update.

Type:
Since: 3.0.0
Default Value:
  • null
Source: src/cameras/controls/SmoothedKeyControl.js (Line 56)

<nullable> down :Phaser.Input.Keyboard.Key

The Key to be pressed that will move the Camera down.

Type:
Since: 3.0.0
Default Value:
  • null
Source: src/cameras/controls/SmoothedKeyControl.js (Line 96)

dragX :number

The horizontal drag applied to the camera when it is moving.

Type:
  • number
Since: 3.0.0
Default Value:
  • 0
Source: src/cameras/controls/SmoothedKeyControl.js (Line 169)

dragY :number

The vertical drag applied to the camera when it is moving.

Type:
  • number
Since: 3.0.0
Default Value:
  • 0
Source: src/cameras/controls/SmoothedKeyControl.js (Line 179)

<nullable> left :Phaser.Input.Keyboard.Key

The Key to be pressed that will move the Camera left.

Type:
Since: 3.0.0
Default Value:
  • null
Source: src/cameras/controls/SmoothedKeyControl.js (Line 66)

maxSpeedX :number

The maximum horizontal speed the camera will move.

Type:
  • number
Since: 3.0.0
Default Value:
  • 0
Source: src/cameras/controls/SmoothedKeyControl.js (Line 202)

maxSpeedY :number

The maximum vertical speed the camera will move.

Type:
  • number
Since: 3.0.0
Default Value:
  • 0
Source: src/cameras/controls/SmoothedKeyControl.js (Line 212)

The Key to be pressed that will move the Camera right.

Type:
Since: 3.0.0
Default Value:
  • null
Source: src/cameras/controls/SmoothedKeyControl.js (Line 76)

<nullable> up :Phaser.Input.Keyboard.Key

The Key to be pressed that will move the Camera up.

Type:
Since: 3.0.0
Default Value:
  • null
Source: src/cameras/controls/SmoothedKeyControl.js (Line 86)

<nullable> zoomIn :Phaser.Input.Keyboard.Key

The Key to be pressed that will zoom the Camera in.

Type:
Since: 3.0.0
Default Value:
  • null
Source: src/cameras/controls/SmoothedKeyControl.js (Line 106)

<nullable> zoomOut :Phaser.Input.Keyboard.Key

The Key to be pressed that will zoom the Camera out.

Type:
Since: 3.0.0
Default Value:
  • null
Source: src/cameras/controls/SmoothedKeyControl.js (Line 116)

zoomSpeed :number

The speed at which the camera will zoom if the zoomIn or zoomOut keys are pressed.

Type:
  • number
Since: 3.0.0
Default Value:
  • 0.01
Source: src/cameras/controls/SmoothedKeyControl.js (Line 126)

Methods


destroy()

Destroys this Key Control.

Since: 3.0.0
Source: src/cameras/controls/SmoothedKeyControl.js (Line 462)

setCamera(camera)

Binds this Key Control to a camera.

Parameters:
Name Type Description
camera Phaser.Cameras.Scene2D.Camera

The camera to bind this Key Control to.

Since: 3.0.0
Source: src/cameras/controls/SmoothedKeyControl.js (Line 308)
Returns:

This Key Control instance.

Type
Phaser.Cameras.Controls.SmoothedKeyControl

start()

Starts the Key Control running, providing it has been linked to a camera.

Since: 3.0.0
Source: src/cameras/controls/SmoothedKeyControl.js (Line 278)
Returns:

This Key Control instance.

Type
Phaser.Cameras.Controls.SmoothedKeyControl

stop()

Stops this Key Control from running. Call start to start it again.

Since: 3.0.0
Source: src/cameras/controls/SmoothedKeyControl.js (Line 293)
Returns:

This Key Control instance.

Type
Phaser.Cameras.Controls.SmoothedKeyControl

update(delta)

[description]

Parameters:
Name Type Description
delta number

The delta time, in ms, elapsed since the last frame.

Since: 3.0.0
Source: src/cameras/controls/SmoothedKeyControl.js (Line 325)