From 27fa44a01db5c995daa534da5d6c1f3212d3967d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E1=84=8B=E1=85=A2=E1=84=91=E1=85=B3=E1=86=AF=20=E1=84=82?= =?UTF-8?q?=E1=85=A9=E1=84=90=E1=85=B3=E1=84=87=E1=85=AE=E1=86=A8?= Date: Fri, 15 Mar 2019 08:52:45 +0900 Subject: [PATCH] Add: setup button on screen_top_ui --- src/game/lib/text/screen_top_ui.js | 31 ++++++++++++++++++++++++++++++ src/game/menu/menu_app.js | 1 + 2 files changed, 32 insertions(+) diff --git a/src/game/lib/text/screen_top_ui.js b/src/game/lib/text/screen_top_ui.js index 02d3177..6a42354 100644 --- a/src/game/lib/text/screen_top_ui.js +++ b/src/game/lib/text/screen_top_ui.js @@ -19,6 +19,37 @@ ScreenTopUI.prototype.makeHomeButton = function(eventHandler) { this.homeButton = new HomeButton(eventHandler); } + +ScreenTopUI.prototype.makeSetupButton = function(eventHandler) { + var setting = new RoundRectButtonSetting(GAME_SCREEN_SIZE.x - 30, 30, 50, 50); + setting.fontStyle.boundsAlignH = "center"; // left, center. right + setting.fontStyle.boundsAlignV = "middle"; // top, middle, bottom + var backupFontSize = setting.fontStyle.font; + setting.fontStyle.font = "18px Arial"; + setting.strokeWidthPx = 3; + setting.setStrokeColor( + 0xaa6666, + 0x884444, + 0x884444, + 0x333333 + ); + setting.setButtonColor( + 0xffdddd, + 0xddaaaa, + 0xddaaaa, + 0x666666 + ); + setting.setTextColor( + "#a66", + "#844", + "#844", + "#333" + ); + + this.setupButton = new RoundRectButton(setting, RoundRectButton.NONE_ICON, "설정", eventHandler); + setting.fontStyle.font = backupFontSize; +} + ScreenTopUI.prototype.makeFullScreenButton = function() { // this.fullscreenButton = new FullscreenButton(); } diff --git a/src/game/menu/menu_app.js b/src/game/menu/menu_app.js index 4c01650..85adc10 100644 --- a/src/game/menu/menu_app.js +++ b/src/game/menu/menu_app.js @@ -44,6 +44,7 @@ var MenuApp = { // top ui var screenTopUI = new ScreenTopUI(); screenTopUI.makeBackButton( (function() { this.back(); }).bind(this) ); + screenTopUI.makeSetupButton( (function() { console.log("setup"); }).bind(this) ); screenTopUI.makeFullScreenButton();