Phaser.StageScaleMode has been renamed to ScaleManager and moved from the system folder to the core folder. It's still available under game.scale.

If your game references the old Phaser.StageScaleMode consts like SHOW_ALL you need to update them to Phaser.ScaleManager, i.e. Phaser.ScaleManager.SHOW_ALL.
All of the Project Templates have been updated to reflect the above change.
This commit is contained in:
photonstorm
2014-02-25 14:46:48 +00:00
parent fdde4cb7e6
commit 13c99f3491
22 changed files with 321 additions and 112 deletions
+13 -13
View File
@@ -1,4 +1,4 @@
BasicGame = {};
var BasicGame = {};
BasicGame.Boot = function (game) {
@@ -17,33 +17,33 @@ BasicGame.Boot.prototype = {
create: function () {
// Unless you specifically know your game needs to support multi-touch I would recommend setting this to 1
this.game.input.maxPointers = 1;
this.input.maxPointers = 1;
// Phaser will automatically pause if the browser tab the game is in loses focus. You can disable that here:
this.game.stage.disableVisibilityChange = true;
this.stage.disableVisibilityChange = true;
if (this.game.device.desktop)
{
// If you have any desktop specific settings, they can go in here
this.game.stage.scale.pageAlignHorizontally = true;
this.scale.pageAlignHorizontally = true;
}
else
{
// Same goes for mobile settings.
// In this case we're saying "scale the game, no lower than 480x260 and no higher than 1024x768"
this.game.stage.scaleMode = Phaser.StageScaleMode.SHOW_ALL;
this.game.stage.scale.minWidth = 480;
this.game.stage.scale.minHeight = 260;
this.game.stage.scale.maxWidth = 1024;
this.game.stage.scale.maxHeight = 768;
this.game.stage.scale.forceLandscape = true;
this.game.stage.scale.pageAlignHorizontally = true;
this.game.stage.scale.setScreenSize(true);
this.scale.scaleMode = Phaser.ScaleManager.SHOW_ALL;
this.scale.minWidth = 480;
this.scale.minHeight = 260;
this.scale.maxWidth = 1024;
this.scale.maxHeight = 768;
this.scale.forceLandscape = true;
this.scale.pageAlignHorizontally = true;
this.scale.setScreenSize(true);
}
// By this point the preloader assets have loaded to the cache, we've set the game settings
// So now let's start the real preloader going
this.game.state.start('Preloader');
this.state.start('Preloader');
}
+3 -2
View File
@@ -13,7 +13,8 @@ BasicGame.Game = function (game) {
this.sound; // the sound manager - add a sound, play one, set-up markers, etc
this.stage; // the game stage
this.time; // the clock
this.tweens; // the tween manager
this.tweens; // the tween manager
this.state; // the state manager
this.world; // the game world
this.particles; // the particle manager
this.physics; // the physics manager
@@ -44,7 +45,7 @@ BasicGame.Game.prototype = {
// Stop music, delete sprites, purge caches, free resources, all that good stuff.
// Then let's go back to the main menu.
this.game.state.start('MainMenu');
this.state.start('MainMenu');
}
@@ -35,7 +35,7 @@ BasicGame.MainMenu.prototype = {
this.music.stop();
// And start the actual game
this.game.state.start('Game');
this.state.start('Game');
}
@@ -53,7 +53,7 @@ BasicGame.Preloader.prototype = {
if (this.cache.isSoundDecoded('titleMusic') && this.ready == false)
{
this.ready = true;
this.game.state.start('MainMenu');
this.state.start('MainMenu');
}
}