Phaser API Documentation

  Version: 
setPerspective(value)

Description:

Sets the perspective CSS property of the parent DOM Container. This determines the distance between the z=0 plane and the user in order to give a 3D-positioned element some perspective. Each 3D element with z > 0 becomes larger; each 3D-element with z < 0 becomes smaller. The strength of the effect is determined by the value of this property.

For more information see: https://developer.mozilla.org/en-US/docs/Web/CSS/perspective

Changing this value changes it globally for all DOM Elements, as they all share the same parent container.

Parameters:

name type description
value number

The perspective value, in pixels, that determines the distance between the z plane and the user.

Returns:
Description:

This DOM Element instance.

Since: 3.17.0