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#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#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#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#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#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#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#sourceAspectRatio

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

ScaleManager#startFullScreen()

startFullScreen(antialias, allowTrampoline) → {boolean} Start the browsers fullscreen mode - this must be called from a user input Pointer or Mouse event. The Fullscreen API must be supported by the browser for this to work - it is not the same as settingthe game size to fill the browser window. See compatibility.supportsFullScreen to check if the currentdevice is reported to support fullscreen mode. The fullScreenFailed signal will be dispatched if the fullscreen change request failed or the

ScaleManager#stopFullScreen()

stopFullScreen() → {boolean} Stops / exits fullscreen mode, if active. Returns boolean - Returns true if the browser supports fullscreen mode and fullscreen mode will be exited. Source code: core/ScaleManager.js (Line 1842)