Phaser API Documentation

zoomTo(zoom, [duration], [ease], [force], [callback], [context])


This effect will zoom the Camera to the given scale, over the duration and with the ease specified.


name type arguments Default description
zoom number

The target Camera zoom value.

duration number <optional> 1000

The duration of the effect in milliseconds.

ease string | function <optional> 'Linear'

The ease to use for the pan. Can be any of the Phaser Easing constants or a custom function.

force boolean <optional> false

Force the pan effect to start immediately, even if already running.

callback Phaser.Types.Cameras.Scene2D.CameraPanCallback <optional>

This callback will be invoked every frame for the duration of the effect. It is sent four arguments: A reference to the camera, a progress amount between 0 and 1 indicating how complete the effect is, the current camera scroll x coordinate and the current camera scroll y coordinate.

context any <optional>

The context in which the callback is invoked. Defaults to the Scene to which the Camera belongs.


This Camera instance.

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