Add: ESC key back(), Enter key start/restart to all features

This commit is contained in:
2018-10-14 09:13:11 +09:00
parent 18150fc332
commit 99e99b3c80
23 changed files with 218 additions and 55 deletions
+15 -3
View File
@@ -19,11 +19,18 @@ var Ranking = {
// phaser.alpha = 0.1;
// keyboard shortcut
this.keyboardShortcut = new KeyboardShortcut();
this.keyboardShortcut.addCallback(
Phaser.KeyCode.ESC, // keyCode
null, // keyDownHandler
(function() { this.back(); }).bind(this), // keyUpHandler
"ranking" // callerClassName
);
// top ui
var screenTopUI = new ScreenTopUI();
screenTopUI.makeBackButton( function() {
location.href = '../../web/client/start.html';
});
screenTopUI.makeBackButton( (function() { this.back(); }).bind(this) );
screenTopUI.makeFullScreenButton();
@@ -69,6 +76,11 @@ var Ranking = {
game.time.events.loop(Phaser.Timer.SECOND * 10, this.getRecordToRankingServer, this);
},
back: function() {
location.href = '../../web/client/start.html';
},
makeTextButton: function(x, y, buttonText, eventListener) {
var setting = new RoundRectButtonSetting(x, y, 200, 100);
setting.fontStyle.fontWeight = "bold";