Phaser API Documentation

  Version: 

Member of: Phaser.Structs.Size

setAspectRatio(ratio)

Description:

Sets a new aspect ratio, overriding what was there previously.

It then calls setSize immediately using the current dimensions.

Parameters:

name type description
ratio number

The new aspect ratio.

Returns:
Description:

This Size component instance.

Since: 3.16.0
Source: src/structs/Size.js (Line 361)