Phaser API Documentation

  Version: 
remove(camera, [runDestroy])

Description:

Removes the given Camera, or an array of Cameras, from this Camera Manager.

If found in the Camera Manager it will be immediately removed from the local cameras array. If also currently the 'main' camera, 'main' will be reset to be camera 0.

The removed Cameras are automatically destroyed if the runDestroy argument is true, which is the default. If you wish to re-use the cameras then set this to false, but know that they will retain their references and internal data until destroyed or re-added to a Camera Manager.

Parameters:

name type arguments Default description
camera Phaser.Cameras.Scene2D.Camera | Array.<Phaser.Cameras.Scene2D.Camera>

The Camera, or an array of Cameras, to be removed from this Camera Manager.

runDestroy boolean <optional> true

Automatically call Camera.destroy on each Camera removed from this Camera Manager.

Returns:
Description:

The total number of Cameras removed.

Type:
  • number
Since: 3.0.0