Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • OleL/a-awesome-game
  • HoelShare/a-awesome-game
2 results
Show changes
Commits on Source (2)
Phaser.Device.whenReady(function () {
game.plugins.add(PhaserInput.Plugin);
});
\ No newline at end of file
var Login = {
nameBox: null
};
Login.init = function() {
if(false === game.device.desktop){
this.optimizeMobileView();
}
game.scale.pageAlignHorizontally = true;
}
Login.optimizeMobileView = function() {
console.log('W : '+window.screen.width+', H : '+window.screen.height);
if(Math.min(window.screen.width, window.screen.height) < game.width) { // If at least one of the two screen dimensions is smaller for the game, enable asking for device reorientation
game.scale.scaleMode = Phaser.ScaleManager.RESIZE;
game.scale.forceOrientation(true,false);
}
}
Login.preload = function() {
};
Login.create = function() {
this.stage.backgroundColor = 0x00F0F0;
this.nameBox = game.add.inputField(10, 90, {
font: '18px Arial',
fill: '#212121',
width: this.game.width - 36,
padding: 8,
borderWidth: 1,
borderColor: '#000',
borderRadius: 6,
placeHolder: 'Please enter your name'
});
this.loginButton = game.add.button(10, 130, '', Login.login, this);
};
Login.login = function() {
};
\ No newline at end of file
var game = new Phaser.Game(
800,
600,
Phaser.CANVAS,
document.getElementById('game-div'),
null,
false,
true);
game.state.add('Login', Login);
//game.state.add('Game', Game);
game.state.start('Login');
../node_modules/@orange-games/phaser-input/build/phaser-input.js
\ No newline at end of file
../node_modules/phaser-ce/build/phaser.js
\ No newline at end of file
<html>
<head>
<title>a-awesome-game</title>
</head>
<body>
<div id="game-div"></div>
</body>
<script type="text/javascript" src="client/phaser.js"></script>
<script type="text/javascript" src="client/phaser-input.js"></script>
<script type="text/javascript" src="client/login.js"></script>
<script type="text/javascript" src="client/main.js"></script>
<script type="text/javascript" src="client/init.js"></script>
</html>
\ No newline at end of file