Namespace: Scene2D

Phaser.Types.Cameras. Scene2D

Type Definitions


CameraConfig

Type:
  • object
Properties:
Name Type Argument Default Description
name string <optional>
''

The name of the Camera.

x number <optional>
0

The horizontal position of the Camera viewport.

y number <optional>
0

The vertical position of the Camera viewport.

width number <optional>

The width of the Camera viewport.

height number <optional>

The height of the Camera viewport.

zoom number <optional>
1

The default zoom level of the Camera.

rotation number <optional>
0

The rotation of the Camera, in radians.

roundPixels boolean <optional>
false

Should the Camera round pixels before rendering?

scrollX number <optional>
0

The horizontal scroll position of the Camera.

scrollY number <optional>
0

The vertical scroll position of the Camera.

backgroundColor false | string <optional>
false

A CSS color string controlling the Camera background color.

bounds object <optional>
<nullable>

Defines the Camera bounds.

Properties
Name Type Argument Default Description
x number <optional>
0

The top-left extent of the Camera bounds.

y number <optional>
0

The top-left extent of the Camera bounds.

width number <optional>

The width of the Camera bounds.

height number <optional>

The height of the Camera bounds.

Since: 3.0.0
Source: src/cameras/2d/typedefs/CameraConfig.js (Line 1)

CameraFadeCallback(camera, progress)

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

The camera on which the effect is running.

progress number

The progress of the effect. A value between 0 and 1.

Since: 3.5.0
Source: src/cameras/2d/typedefs/CameraFadeCallback.js (Line 1)

CameraFlashCallback(camera, progress)

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

The camera on which the effect is running.

progress number

The progress of the effect. A value between 0 and 1.

Since: 3.5.0
Source: src/cameras/2d/typedefs/CameraFlashCallback.js (Line 1)

CameraPanCallback(camera, progress, x, y)

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

The camera on which the effect is running.

progress number

The progress of the effect. A value between 0 and 1.

x number

The Camera's new scrollX coordinate.

y number

The Camera's new scrollY coordinate.

Since: 3.5.0
Source: src/cameras/2d/typedefs/CameraPanCallback.js (Line 1)

CameraShakeCallback(camera, progress)

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

The camera on which the effect is running.

progress number

The progress of the effect. A value between 0 and 1.

Since: 3.5.0
Source: src/cameras/2d/typedefs/CameraShakeCallback.js (Line 1)

CameraZoomCallback(camera, progress, zoom)

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

The camera on which the effect is running.

progress number

The progress of the effect. A value between 0 and 1.

zoom number

The Camera's new zoom value.

Since: 3.11.0
Source: src/cameras/2d/typedefs/CameraZoomCallback.js (Line 1)

JSONCamera

Type:
  • object
Properties:
Name Type Argument Description
name string

The name of the camera

x number

The horizontal position of camera

y number

The vertical position of camera

width number

The width size of camera

height number

The height size of camera

zoom number

The zoom of camera

rotation number

The rotation of camera

roundPixels boolean

The round pixels st status of camera

scrollX number

The horizontal scroll of camera

scrollY number

The vertical scroll of camera

backgroundColor string

The background color of camera

bounds Phaser.Types.Cameras.Scene2D.JSONCameraBounds | undefined <optional>

The bounds of camera

Since: 3.0.0
Source: src/cameras/2d/typedefs/JSONCamera.js (Line 1)

JSONCameraBounds

Type:
  • object
Properties:
Name Type Description
x number

The horizontal position of camera

y number

The vertical position of camera

width number

The width size of camera

height number

The height size of camera

Since: 3.0.0
Source: src/cameras/2d/typedefs/JSONCameraBounds.js (Line 1)