mirror of
https://github.com/wassname/phaser.git
synced 2026-07-28 11:23:50 +08:00
Fullscreen mode now uses window.outerWidth/Height when using EXACT_FIT as the scale mode, which fixes input coordinate errors (fixes #232)
Fullscreen mode now works in Internet Explorer and uses the new fullscreen non-prefix call.
This commit is contained in:
+3
-1
@@ -394,7 +394,7 @@ Phaser.Game.prototype = {
|
||||
|
||||
this.isBooted = true;
|
||||
|
||||
this.device = new Phaser.Device();
|
||||
this.device = new Phaser.Device(this);
|
||||
this.math = Phaser.Math;
|
||||
this.rnd = new Phaser.RandomDataGenerator([(Date.now() * Math.random()).toString()]);
|
||||
|
||||
@@ -403,6 +403,8 @@ Phaser.Game.prototype = {
|
||||
|
||||
this.setUpRenderer();
|
||||
|
||||
this.device.checkFullScreenSupport();
|
||||
|
||||
this.world = new Phaser.World(this);
|
||||
this.add = new Phaser.GameObjectFactory(this);
|
||||
this.make = new Phaser.GameObjectCreator(this);
|
||||
|
||||
@@ -262,35 +262,26 @@ Phaser.ScaleManager.prototype = {
|
||||
*/
|
||||
startFullScreen: function (antialias) {
|
||||
|
||||
if (this.isFullScreen)
|
||||
if (this.isFullScreen || !this.game.device.fullscreen)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (typeof antialias !== 'undefined' && this.game.renderType === Phaser.CANVAS)
|
||||
{
|
||||
Phaser.Canvas.setSmoothingEnabled(this.game.context, antialias);
|
||||
this.game.stage.smoothed = antialias;
|
||||
}
|
||||
|
||||
var element = this.game.canvas;
|
||||
|
||||
this._width = this.width;
|
||||
this._height = this.height;
|
||||
|
||||
// This needs updating to match the final spec:
|
||||
// http://generatedcontent.org/post/70347573294/is-your-fullscreen-api-code-up-to-date-find-out-how-to
|
||||
|
||||
if (element['requestFullScreen'])
|
||||
if (this.game.device.fullscreenKeyboard)
|
||||
{
|
||||
element['requestFullScreen']();
|
||||
this.game.canvas[this.game.device.requestFullscreen](Element.ALLOW_KEYBOARD_INPUT);
|
||||
}
|
||||
else if (element['mozRequestFullScreen'])
|
||||
else
|
||||
{
|
||||
element.parentNode['mozRequestFullScreen']();
|
||||
}
|
||||
else if (element['webkitRequestFullScreen'])
|
||||
{
|
||||
element['webkitRequestFullScreen'](Element.ALLOW_KEYBOARD_INPUT);
|
||||
this.game.canvas[this.game.device.requestFullscreen]();
|
||||
}
|
||||
|
||||
},
|
||||
@@ -301,18 +292,7 @@ Phaser.ScaleManager.prototype = {
|
||||
*/
|
||||
stopFullScreen: function () {
|
||||
|
||||
if (document['cancelFullScreen'])
|
||||
{
|
||||
document['cancelFullScreen']();
|
||||
}
|
||||
else if (document['mozCancelFullScreen'])
|
||||
{
|
||||
document['mozCancelFullScreen']();
|
||||
}
|
||||
else if (document['webkitCancelFullScreen'])
|
||||
{
|
||||
document['webkitCancelFullScreen']();
|
||||
}
|
||||
this.game.canvas[this.game.device.cancelFullscreen]();
|
||||
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user