ScaleManager#sourceAspectRatio

[readonly] sourceAspectRatio : number The aspect ratio of the original game dimensions. Source code: core/ScaleManager.js (Line 356)

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 s

ScaleManager#setResizeCallback()

setResizeCallback(callback, context) Sets the callback that will be invoked before sizing calculations. This is the appropriate place to call setUserScale if needing custom dynamic scaling. The callback is supplied with two arguments scale and parentBounds where scale is the ScaleManagerand parentBounds, a Phaser.Rectangle, is the size of the Parent element. This callback May be invoked even though the parent container or canvas sizes have not changed Unlike onSizeChange, it runs before the c

ScaleManager#setMinMax()

setMinMax(minWidth, minHeight, maxWidth, maxHeight) Set the min and max dimensions for the Display canvas. Note: The min/max dimensions are only applied in some cases When the device is not in an incorrect orientation; or The scale mode is EXACT_FIT when not in fullscreen Parameters Name Type Argument Description minWidth number The minimum width the game is allowed to scale down to. minHeight number The minimum height the game is allowed to scale down to. maxWidth number <opti

ScaleManager#setGameSize()

setGameSize(width, height) Set the actual Game size.Use this instead of directly changing game.width or game.height. The actual physical display (Canvas element size) depends on various settings including Scale mode Scaling factor Size of Canvas's parent element or CSS rules such as min-height/max-height; The size of the Window Parameters Name Type Description width integer Game width, in pixels. height integer Game height, in pixels. Source code: core/ScaleManager.js (Line 881)

ScaleManager#screenOrientation

[readonly] screenOrientation : string The last known orientation of the screen, as defined in the Window Screen Web API.See Phaser.DOM.getScreenOrientation for possible values. Source code: core/ScaleManager.js (Line 311)

ScaleManager#scaleMode

scaleMode : integer The scaling method used by the ScaleManager when not in fullscreen. Phaser.ScaleManager.NO_SCALE The Game display area will not be scaled - even if it is too large for the canvas/screen. This mode ignores any applied scaling factor and displays the canvas at the Game size. Phaser.ScaleManager.EXACT_FIT The Game display area will be stretched to fill the entire size of the canvas's parent element and/or screen. Proportions are not maintained. Phaser.ScaleManager.SHOW_AL

ScaleManager#ScaleManager

new ScaleManager(game, width, height) Create a new ScaleManager object - this is done automatically by Phaser.Game The width and height constructor parameters can either be a number which represents pixels or a string that represents a percentage: e.g. 800 (for 800 pixels) or "80%" for 80%. Parameters Name Type Description game Phaser.Game A reference to the currently running game. width number | string The width of the game. See above. height number | string The height of the game. Se

ScaleManager#scaleFactor

[readonly] scaleFactor : Phaser.Point The current scale factor based on the game dimensions vs. the scaled dimensions. Source code: core/ScaleManager.js (Line 318)

ScaleManager#refresh()

refresh() The "refresh" methods informs the ScaleManager that a layout refresh is required. The ScaleManager automatically queues a layout refresh (eg. updates the Game size or Display canvas layout)when the browser is resized, the orientation changes, or when there is a detected changeof the Parent size. Refreshing is also done automatically when public properties,such as scaleMode, are updated or state-changing methods are invoked. The "refresh" method may need to be used in a few (rare) si