Phaser API Documentation

  Version: 
setOrigin([x], [y])

Description:

Sets the rotation origin of this Camera.

The values are given in the range 0 to 1 and are only used when calculating Camera rotation.

By default the camera rotates around the center of the viewport.

Changing the origin allows you to adjust the point in the viewport from which rotation happens. A value of 0 would rotate from the top-left of the viewport. A value of 1 from the bottom right.

Parameters:

name type arguments Default description
x number <optional> 0.5

The horizontal origin value.

y number <optional> x

The vertical origin value. If not defined it will be set to the value of x.

Returns:
Description:

This Camera instance.

Since: 3.11.0