ScaleManager#setUserScale()

setUserScale(hScale, vScale, hTrim, vTrim)

Set a User scaling factor used in the USER_SCALE scaling mode.

The target canvas size is computed by:

canvas.width = (game.width * hScale) - hTrim
canvas.height = (game.height * vScale) - vTrim

This method can be used in the resize callback.

Parameters
Name Type Argument Default Description
hScale number

Horizontal scaling factor.

vScale numer

Vertical scaling factor.

hTrim integer <optional>
0

Horizontal trim, applied after scaling.

vTrim integer <optional>
0

Vertical trim, applied after scaling.

Source code: core/ScaleManager.js (Line 909)
doc_phaser
2017-02-14 11:09:17
Comments
Leave a Comment

Please login to continue.