Skip to main content
Version: Phaser v3.90.0

Types.Cameras.Controls

FixedKeyControlConfig

<static> FixedKeyControlConfig

nametypeoptionaldefaultdescription
cameraPhaser.Cameras.Scene2D.CameraYesThe Camera that this Control will update.
leftPhaser.Input.Keyboard.KeyYesThe Key to be pressed that will move the Camera left.
rightPhaser.Input.Keyboard.KeyYesThe Key to be pressed that will move the Camera right.
upPhaser.Input.Keyboard.KeyYesThe Key to be pressed that will move the Camera up.
downPhaser.Input.Keyboard.KeyYesThe Key to be pressed that will move the Camera down.
zoomInPhaser.Input.Keyboard.KeyYesThe Key to be pressed that will zoom the Camera in.
zoomOutPhaser.Input.Keyboard.KeyYesThe Key to be pressed that will zoom the Camera out.
zoomSpeednumberYes0.01The speed at which the camera will zoom if the zoomIn or zoomOut keys are pressed.
speednumber | ObjectYes0The horizontal and vertical speed the camera will move.
minZoomnumberYes0.001The smallest zoom value the camera will reach when zoomed out.
maxZoomnumberYes1000The largest zoom value the camera will reach when zoomed in.

Type: object

Member of: Phaser.Types.Cameras.Controls

Source: src/cameras/controls/typedefs/FixedKeyControlConfig.js#L1
Since: 3.0.0


SmoothedKeyControlConfig

<static> SmoothedKeyControlConfig

nametypeoptionaldefaultdescription
cameraPhaser.Cameras.Scene2D.CameraYesThe Camera that this Control will update.
leftPhaser.Input.Keyboard.KeyYesThe Key to be pressed that will move the Camera left.
rightPhaser.Input.Keyboard.KeyYesThe Key to be pressed that will move the Camera right.
upPhaser.Input.Keyboard.KeyYesThe Key to be pressed that will move the Camera up.
downPhaser.Input.Keyboard.KeyYesThe Key to be pressed that will move the Camera down.
zoomInPhaser.Input.Keyboard.KeyYesThe Key to be pressed that will zoom the Camera in.
zoomOutPhaser.Input.Keyboard.KeyYesThe Key to be pressed that will zoom the Camera out.
zoomSpeednumberYes0.01The speed at which the camera will zoom if the zoomIn or zoomOut keys are pressed.
accelerationnumber | ObjectYes0The horizontal and vertical acceleration the camera will move.
dragnumber | ObjectYes0The horizontal and vertical drag applied to the camera when it is moving.
maxSpeednumber | ObjectYes0The maximum horizontal and vertical speed the camera will move.
minZoomnumberYes0.001The smallest zoom value the camera will reach when zoomed out.
maxZoomnumberYes1000The largest zoom value the camera will reach when zoomed in.

Type: object

Member of: Phaser.Types.Cameras.Controls

Source: src/cameras/controls/typedefs/SmoothedKeyControlConfig.js#L1
Since: 3.0.0