Phaser API Documentation

  Version: 
<nullable> deadzone: Phaser.Geom.Rectangle

Description:

The Camera dead zone.

The deadzone is only used when the camera is following a target.

It defines a rectangular region within which if the target is present, the camera will not scroll. If the target moves outside of this area, the camera will begin scrolling in order to follow it.

The lerp values that you can set for a follower target also apply when using a deadzone.

You can directly set this property to be an instance of a Rectangle. Or, you can use the setDeadzone method for a chainable approach.

The rectangle you provide can have its dimensions adjusted dynamically, however, please note that its position is updated every frame, as it is constantly re-centered on the cameras mid point.

Calling setDeadzone with no arguments will reset an active deadzone, as will setting this property to null.

Since: 3.11.0
Source: src/cameras/2d/Camera.js (Line 174)