Created
February 26, 2015 21:18
-
-
Save sebbdk/41f3d264e6c6862b3fab to your computer and use it in GitHub Desktop.
example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
function Boot() { | |
} | |
Boot.prototype = { | |
preload: function() { | |
this.load.image('preloader', 'assets/preloader.gif'); | |
}, | |
create: function() { | |
var self = this; | |
self.game.input.maxPointers = 1; | |
self.game.state.start('preload'); | |
self.resizeGame(); | |
$(window).resize(function() { self.resizeGame(); } ); | |
}, | |
resizeGame:function() { | |
var height = $(window).height(); | |
var width = $(window).width(); | |
this.game.width = width; | |
this.game.height = height; | |
this.game.stage.getBounds().width = width; | |
this.game.stage.getBounds().height = height; | |
//this.game.stage.bounds.width = width; | |
//this.game.stage.bounds.height = height; | |
if (this.game.renderType === Phaser.WEBGL) { | |
this.game.renderer.resize(width, height); | |
} | |
//var left = $(window).outerWidth()/2 - ($('.dialog').outerWidth()/2); | |
//$('.dialog').css('left', left+'px'); | |
} | |
}; | |
module.exports = Boot; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment