API Docs for: 1.4.0
Show:

Kiwi.CameraManager Class

Module: Kiwi

Used to handle the creation and management of Cameras on a Game. Each Game will always have created for it a CameraManager and a default Camera on the manager. Games currently only usupport the use of a single camera, the default camera. Much of this class has been written with future multiple camera support in mind.

Constructor

Kiwi.CameraManager

(
  • game
)
Kiwi.CameraManager

Parameters:

Returns:

Methods

boot

() public

Initializes the CameraManager, creates a new camera and assigns it to the defaultCamera

objType

() String public

Returns the type of this object

Returns:

String:

"CameraManager"

remove

(
  • camera
)
Boolean public

Removes the given camera, if it is present in the camera managers camera collection.

Parameters:

Returns:

Boolean:

True if the camera was removed, false otherwise.

removeAll

() public

Removes all cameras in the camera Manager except the default camera. Does nothing if in multi camera mode.

render

() public

Calls the render method on all the cameras

update

() public

Calls update on all the cameras.

zeroAllCameras

() public

Defined in src\core\CameraManager.ts:166

Available since 1.1.0

Returns all cameras to origin. Called when starting a new state.

zeroCamera

(
  • camera
)
public

Defined in src\core\CameraManager.ts:180

Available since 1.1.0

Returns camera to origin.

Parameters:

Properties

_cameras

Array private

A collection of cameras

_game

Kiwi.Game private

The game this object belongs to

_nextCameraID

Number private

The id which will be used when next creating a camera

defaultCamera

Kiwi.Camara public

The default camera that is on this manager.