Config#snapWidth and Config#snapHeight are new properties in the Game Config that hold the parsed snap config values, as used by the Scale Manager.

This commit is contained in:
Richard Davey 2024-02-19 16:35:27 +00:00
parent 1199178eff
commit d2ce0f9358
2 changed files with 11 additions and 0 deletions

View file

@ -121,6 +121,16 @@ var Config = new Class({
*/
this.maxHeight = GetValue(scaleConfig, 'max.height', 0, config);
/**
* @const {number} Phaser.Core.Config#snapWidth - The horizontal amount to snap the canvas by when the Scale Manager is resizing. A value of zero means no snapping.
*/
this.snapWidth = GetValue(scaleConfig, 'snap.width', 0, config);
/**
* @const {number} Phaser.Core.Config#snapHeight - The vertical amount to snap the canvas by when the Scale Manager is resizing. A value of zero means no snapping.
*/
this.snapHeight = GetValue(scaleConfig, 'snap.height', 0, config);
/**
* @const {number} Phaser.Core.Config#renderType - Force Phaser to use a specific renderer. Can be `CONST.CANVAS`, `CONST.WEBGL`, `CONST.HEADLESS` or `CONST.AUTO` (default)
*/

View file

@ -10,6 +10,7 @@
* @property {Phaser.Scale.ScaleModeType} [mode=Phaser.Scale.ScaleModes.NONE] - The scale mode.
* @property {WidthHeight} [min] - The minimum width and height the canvas can be scaled down to.
* @property {WidthHeight} [max] - The maximum width the canvas can be scaled up to.
* @property {WidthHeight} [snap] - Set the snapping values used by the Scale Manager when resizing the canvas. See `ScaleManager.setSnap` for details.
* @property {boolean} [autoRound=false] - Automatically round the display and style sizes of the canvas. This can help with performance in lower-powered devices.
* @property {Phaser.Scale.CenterType} [autoCenter=Phaser.Scale.Center.NO_CENTER] - Automatically center the canvas within the parent?
* @property {number} [resizeInterval=500] - How many ms should elapse before checking if the browser size has changed?