mirror of
https://github.com/wassname/phaser.git
synced 2026-08-14 12:40:17 +08:00
Updated so it no longer always tries to run in fullscreen unless you tell it to.
This commit is contained in:
+6
-1
@@ -4098,7 +4098,7 @@ var FullScreen = (function () {
|
||||
this.refresh();
|
||||
};
|
||||
FullScreen.prototype.update = function () {
|
||||
if(window.innerWidth !== this.width || window.innerHeight !== this.height) {
|
||||
if(this._game.stage.scaleMode !== Stage.SCALE_FIXED && (window.innerWidth !== this.width || window.innerHeight !== this.height)) {
|
||||
this.refresh();
|
||||
}
|
||||
};
|
||||
@@ -4176,6 +4176,8 @@ var Stage = (function () {
|
||||
this.context = this.canvas.getContext('2d');
|
||||
this.offset = this.getOffset(this.canvas);
|
||||
this.bounds = new Rectangle(this.offset.x, this.offset.y, width, height);
|
||||
this.aspectRatio = width / height;
|
||||
this.scaleMode = Stage.SCALE_FIXED;
|
||||
this.fullscreen = new FullScreen(this._game);
|
||||
//document.addEventListener('visibilitychange', (event) => this.visibilityChange(event), false);
|
||||
//document.addEventListener('webkitvisibilitychange', (event) => this.visibilityChange(event), false);
|
||||
@@ -4186,6 +4188,9 @@ var Stage = (function () {
|
||||
return _this.visibilityChange(event);
|
||||
};
|
||||
}
|
||||
Stage.SCALE_FIXED = 0;
|
||||
Stage.SCALE_PROPORTIONAL = 1;
|
||||
Stage.SCALE_FULL = 2;
|
||||
Stage.ORIENTATION_LANDSCAPE = 0;
|
||||
Stage.ORIENTATION_PORTRAIT = 1;
|
||||
Stage.prototype.update = function () {
|
||||
|
||||
Reference in New Issue
Block a user