Namespace: Controls

Phaser.Types.Cameras. Controls

Type Definitions


FixedKeyControlConfig

Type:
  • object
Properties:
Name Type Argument Default Description
camera Phaser.Cameras.Scene2D.Camera <optional>

The Camera that this Control will update.

left Phaser.Input.Keyboard.Key <optional>

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

right Phaser.Input.Keyboard.Key <optional>

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

up Phaser.Input.Keyboard.Key <optional>

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

down Phaser.Input.Keyboard.Key <optional>

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

zoomIn Phaser.Input.Keyboard.Key <optional>

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

zoomOut Phaser.Input.Keyboard.Key <optional>

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

zoomSpeed number <optional>
0.01

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

speed number | Object <optional>
0

The horizontal and vertical speed the camera will move.

Since: 3.0.0
Source: src/cameras/controls/typedefs/FixedKeyControlConfig.js (Line 1)

SmoothedKeyControlConfig

Type:
  • object
Properties:
Name Type Argument Default Description
camera Phaser.Cameras.Scene2D.Camera <optional>

The Camera that this Control will update.

left Phaser.Input.Keyboard.Key <optional>

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

right Phaser.Input.Keyboard.Key <optional>

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

up Phaser.Input.Keyboard.Key <optional>

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

down Phaser.Input.Keyboard.Key <optional>

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

zoomIn Phaser.Input.Keyboard.Key <optional>

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

zoomOut Phaser.Input.Keyboard.Key <optional>

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

zoomSpeed number <optional>
0.01

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

acceleration number | Object <optional>
0

The horizontal and vertical acceleration the camera will move.

drag number | Object <optional>
0

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

maxSpeed number | Object <optional>
0

The maximum horizontal and vertical speed the camera will move.

Since: 3.0.0
Source: src/cameras/controls/typedefs/SmoothedKeyControlConfig.js (Line 1)