Skip to main content
Version: Phaser v4.0.0-rc.6

Types.Cameras.Scene2D

CameraConfig

<static> CameraConfig

nametypeoptionaldefaultdescription
namestringYes"''"The name of the Camera.
xnumberYes0The horizontal position of the Camera viewport.
ynumberYes0The vertical position of the Camera viewport.
widthnumberYesThe width of the Camera viewport.
heightnumberYesThe height of the Camera viewport.
zoomnumberYes1The default zoom level of the Camera.
rotationnumberYes0The rotation of the Camera, in radians.
roundPixelsbooleanYesfalseShould the Camera round pixels before rendering?
scrollXnumberYes0The horizontal scroll position of the Camera.
scrollYnumberYes0The vertical scroll position of the Camera.
backgroundColorfalse | stringYesfalseA CSS color string controlling the Camera background color.
boundsobjectYesDefines the Camera bounds.
bounds.xnumberYes0The top-left extent of the Camera bounds.
bounds.ynumberYes0The top-left extent of the Camera bounds.
bounds.widthnumberYesThe width of the Camera bounds.
bounds.heightnumberYesThe height of the Camera bounds.

Type: object

Member of: Phaser.Types.Cameras.Scene2D

Source: src/cameras/2d/typedefs/CameraConfig.js#L1
Since: 3.0.0


CameraFadeCallback

<static> CameraFadeCallback

Type: function

Member of: Phaser.Types.Cameras.Scene2D

Source: src/cameras/2d/typedefs/CameraFadeCallback.js#L1
Since: 3.5.0


CameraFlashCallback

<static> CameraFlashCallback

Type: function

Member of: Phaser.Types.Cameras.Scene2D

Source: src/cameras/2d/typedefs/CameraFlashCallback.js#L1
Since: 3.5.0


CameraPanCallback

<static> CameraPanCallback

Type: function

Member of: Phaser.Types.Cameras.Scene2D

Source: src/cameras/2d/typedefs/CameraPanCallback.js#L1
Since: 3.5.0


CameraRotateCallback

<static> CameraRotateCallback

Type: function

Member of: Phaser.Types.Cameras.Scene2D

Source: src/cameras/2d/typedefs/CameraRotateCallback.js#L1
Since: 3.23.0


CameraShakeCallback

<static> CameraShakeCallback

Type: function

Member of: Phaser.Types.Cameras.Scene2D

Source: src/cameras/2d/typedefs/CameraShakeCallback.js#L1
Since: 3.5.0


CameraZoomCallback

<static> CameraZoomCallback

Type: function

Member of: Phaser.Types.Cameras.Scene2D

Source: src/cameras/2d/typedefs/CameraZoomCallback.js#L1
Since: 3.11.0


JSONCamera

<static> JSONCamera

nametypeoptionaldescription
namestringNoThe name of the camera
xnumberNoThe horizontal position of camera
ynumberNoThe vertical position of camera
widthnumberNoThe width size of camera
heightnumberNoThe height size of camera
zoomnumberNoThe zoom of camera
rotationnumberNoThe rotation of camera
roundPixelsbooleanNoThe round pixels indicate the status of the camera
scrollXnumberNoThe horizontal scroll of camera
scrollYnumberNoThe vertical scroll of camera
backgroundColorstringNoThe background color of camera
boundsPhaser.Types.Cameras.Scene2D.JSONCameraBounds | undefinedYesThe bounds of camera

Type: object

Member of: Phaser.Types.Cameras.Scene2D

Source: src/cameras/2d/typedefs/JSONCamera.js#L1
Since: 3.0.0


JSONCameraBounds

<static> JSONCameraBounds

nametypeoptionaldescription
xnumberNoThe horizontal position of camera
ynumberNoThe vertical position of camera
widthnumberNoThe width size of camera
heightnumberNoThe height size of camera

Type: object

Member of: Phaser.Types.Cameras.Scene2D

Source: src/cameras/2d/typedefs/JSONCameraBounds.js#L1
Since: 3.0.0