Skip to content

Commit 5370e1e

Browse files
committed
Removed autoResize as no longer needed. Added autoRound property. pixelArt is true if not set and if zoom > 1.
1 parent aec5557 commit 5370e1e

1 file changed

Lines changed: 8 additions & 7 deletions

File tree

src/boot/Config.js

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,6 @@ var ValueToColor = require('../display/color/ValueToColor');
100100
*
101101
* @property {boolean} [antialias=true] - When set to `true`, WebGL uses linear interpolation to draw scaled or rotated textures, giving a smooth appearance. When set to `false`, WebGL uses nearest-neighbor interpolation, giving a crisper appearance. `false` also disables antialiasing of the game canvas itself, if the browser supports it, when the game canvas is scaled.
102102
* @property {boolean} [pixelArt=false] - Sets `antialias` and `roundPixels` to true. This is the best setting for pixel-art games.
103-
* @property {boolean} [autoResize=true] - Automatically resize the Game Canvas if you resize the renderer.
104103
* @property {boolean} [roundPixels=false] - Draw texture-based Game Objects at only whole-integer positions. Game Objects without textures, like Graphics, ignore this property.
105104
* @property {boolean} [transparent=false] - Whether the game canvas will be transparent.
106105
* @property {boolean} [clearBeforeRender=true] - Whether the game canvas will be cleared between each rendering frame.
@@ -124,6 +123,7 @@ var ValueToColor = require('../display/color/ValueToColor');
124123
* @property {integer} [minHeight] - The minimum height the canvas can be scaled down to.
125124
* @property {integer} [maxWidth] - The maximum width the canvas can be scaled up to.
126125
* @property {integer} [maxHeight] - The maximum height the canvas can be scaled up to.
126+
* @property {boolean} [autoRound=false] - Automatically round the display and style sizes of the canvas. This can help with performance in lower-powered devices.
127127
*/
128128

129129
/**
@@ -296,6 +296,11 @@ var Config = new Class({
296296
*/
297297
this.expandParent = GetValue(config, 'expandParent', true);
298298

299+
/**
300+
* @const {integer} Phaser.Boot.Config#autoRound - Automatically round the display and style sizes of the canvas. This can help with performance in lower-powered devices.
301+
*/
302+
this.autoRound = GetValue(config, 'autoRound', false);
303+
299304
/**
300305
* @const {integer} Phaser.Boot.Config#minWidth - The minimum width, in pixels, the canvas will scale down to. A value of zero means no minimum.
301306
*/
@@ -329,6 +334,7 @@ var Config = new Class({
329334
this.parent = GetValue(scaleConfig, 'parent', this.parent);
330335
this.scaleMode = GetValue(scaleConfig, 'mode', this.scaleMode);
331336
this.expandParent = GetValue(scaleConfig, 'expandParent', this.expandParent);
337+
this.autoRound = GetValue(scaleConfig, 'autoRound', this.autoRound);
332338
this.minWidth = GetValue(scaleConfig, 'min.width', this.minWidth);
333339
this.maxWidth = GetValue(scaleConfig, 'max.width', this.maxWidth);
334340
this.minHeight = GetValue(scaleConfig, 'min.height', this.minHeight);
@@ -518,11 +524,6 @@ var Config = new Class({
518524

519525
var renderConfig = GetValue(config, 'render', config);
520526

521-
/**
522-
* @const {boolean} Phaser.Boot.Config#autoResize - Automatically resize the Game Canvas if you resize the renderer.
523-
*/
524-
this.autoResize = GetValue(renderConfig, 'autoResize', true);
525-
526527
/**
527528
* @const {boolean} Phaser.Boot.Config#antialias - When set to `true`, WebGL uses linear interpolation to draw scaled or rotated textures, giving a smooth appearance. When set to `false`, WebGL uses nearest-neighbor interpolation, giving a crisper appearance. `false` also disables antialiasing of the game canvas itself, if the browser supports it, when the game canvas is scaled.
528529
*/
@@ -536,7 +537,7 @@ var Config = new Class({
536537
/**
537538
* @const {boolean} Phaser.Boot.Config#pixelArt - Prevent pixel art from becoming blurred when scaled. It will remain crisp (tells the WebGL renderer to automatically create textures using a linear filter mode).
538539
*/
539-
this.pixelArt = GetValue(renderConfig, 'pixelArt', false);
540+
this.pixelArt = GetValue(renderConfig, 'pixelArt', this.zoom > 1);
540541

541542
if (this.pixelArt)
542543
{

0 commit comments

Comments
 (0)