From 0151a5c285f3c8b5672360cefaa6f9c6c7013e60 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: Sun, 16 Dec 2018 14:42:18 +0900 Subject: [PATCH] Fix: button colors --- src/game/lib/button/home_button.js | 6 ++ src/game/license_timer/input_score.js | 105 +++++++++++++++++++------- src/game/license_timer/login.js | 11 ++- src/game/license_timer/timer.js | 11 +-- 4 files changed, 95 insertions(+), 38 deletions(-) diff --git a/src/game/lib/button/home_button.js b/src/game/lib/button/home_button.js index 3da2935..3f55d59 100644 --- a/src/game/lib/button/home_button.js +++ b/src/game/lib/button/home_button.js @@ -24,6 +24,12 @@ function HomeButton(clickEvent) { "#dca", "#333" ); + setting.setIconColor( + 0xffeecc, + 0xddccaa, + 0xddccaa, + 0x666666 + ); var homeButton = new RoundRectButton(setting, RoundRectButton.NONE_ICON, "", clickEvent); var icon_fullscreen = game.add.sprite(0, 0, "icon_home"); diff --git a/src/game/license_timer/input_score.js b/src/game/license_timer/input_score.js index dacdeb8..8174eb7 100644 --- a/src/game/license_timer/input_score.js +++ b/src/game/license_timer/input_score.js @@ -17,24 +17,10 @@ function InputScore(licenseDataManager, timer, chart) { bar.drawRect(0, this.inputScorePosY, GAME_SCREEN_SIZE.x, 70); - // contents - var setting = new RoundRectButtonSetting(0, 0, 0, 0); - setting.strokeWidthPx = 5; - setting.x = 60; - setting.y = this.inputScorePosY + 35; - setting.width = 100; - setting.height = 50; - setting.roundAmount = 10; - setting.fontStyle.fontSize = 24; - setting.fontStyle.fontWeight = "bold"; - this.subjectButton = new RoundRectButton( - setting, - null, "과목", - (function() { this.onClickSubjectButton(); }).bind(this) - ); + // buttons + this.subjectButton = this.makeSubjectButton(); - - var subjectTextSetting = this.makeInputTextSetting(280, "과목 입력"); + var subjectTextSetting = this.makeInputTextSetting(280, "과목 선택 or 직접 입력"); this.subjectFullnameText = this.makeInputText(120, this.inputScorePosY + 10, subjectTextSetting); this.setSubjectFullname(this.subjectFullname); @@ -55,18 +41,10 @@ function InputScore(licenseDataManager, timer, chart) { passwordTextSetting.type = PhaserInput.InputType.password; this.passwordText = this.makeInputText(game.world.centerX + 260, this.inputScorePosY + 10, passwordTextSetting); + var saveButton = this.makeSaveButton(); - // save button - setting.x = GAME_SCREEN_SIZE.x - 60; - setting.y = this.inputScorePosY + 35; - setting.width = 100; - setting.height = 50; - var set60SecButton = new RoundRectButton( - setting, - null, "저장", - (function() { this.onClickSendToServerButton(); }).bind(this) - ); + // comapny and subject panel + buttons this.makeCompanyPanel(); this.makeSubjectPanel(); this.setVisibleCompanyPanel(false); @@ -123,6 +101,79 @@ InputScore.prototype.setSubjectFullname = function(fullname) { this.subjectFullnameText.setText(this.subjectFullname); } +InputScore.prototype.makeSubjectButton = function() { + var setting = new RoundRectButtonSetting(60, this.inputScorePosY + 35, 100, 50); + setting.strokeWidthPx = 5; + setting.roundAmount = 10; + setting.fontStyle.fontSize = 24; + setting.fontStyle.fontWeight = "bold"; + + // yellow + setting.setStrokeColor( + 0xd0d020, + 0xb0b010, + 0x909000, + 0x333333 + ); + setting.setButtonColor( + 0xf0f040, + 0xd0d030, + 0xb0b020, + 0x666666 + ); + setting.setIconColor( + 0x906020, + 0x704010, + 0x502000, + 0x333333 + ); + setting.setTextColor( + "#962", + "#741", + "#520", + "#333" + ); + + var button = new RoundRectButton( + setting, + null, "과목", + (function() { this.onClickSubjectButton(); }).bind(this) + ); + + return button; +} + +InputScore.prototype.makeSaveButton = function() { + var setting = new RoundRectButtonSetting(GAME_SCREEN_SIZE.x - 60, this.inputScorePosY + 35, 100, 50); + + // cyan + setting.setStrokeColor( + 0x309090, + 0x208080, + 0x205050, + 0x666666 + ); + setting.setButtonColor( + 0x40c0c0, + 0x30a0a0, + 0x208080, + 0x666666 + ); + setting.setTextColor( + "#cee", + "#acc", + "#8aa", + "#333" + ); + + var button = new RoundRectButton( + setting, + null, "저장", + (function() { this.onClickSendToServerButton(); }).bind(this) + ); + return button; +} + InputScore.prototype.onClickSubjectButton = function() { if(!this.companyPanel.visible) this.setVisibleCompanyPanel(true); diff --git a/src/game/license_timer/login.js b/src/game/license_timer/login.js index 35e5544..70468f8 100644 --- a/src/game/license_timer/login.js +++ b/src/game/license_timer/login.js @@ -120,6 +120,7 @@ var Login = { // setting.fontStyle.fontSize = 40; setting.fontStyle.fontWeight = "bold"; + // cyan setting.setStrokeColor( 0x309090, 0x208080, @@ -132,16 +133,14 @@ var Login = { 0x208080, 0x666666 ); - /* setting.setTextColor( - "#fff", - "#edd", - "#dbb", + "#cee", + "#acc", + "#8aa", "#333" ); - */ - var startButton = new RoundRectButton( + var experienceButton = new RoundRectButton( setting, RoundRectButton.NONE_ICON, "체험", (function() { diff --git a/src/game/license_timer/timer.js b/src/game/license_timer/timer.js index 5262fe0..4179cf3 100644 --- a/src/game/license_timer/timer.js +++ b/src/game/license_timer/timer.js @@ -120,6 +120,7 @@ Timer.prototype.makeResetButton = function() { setting.roundAmount = 60; setting.fontStyle.fontSize = 40; + // red setting.setStrokeColor( 0x900020, 0x800010, @@ -159,7 +160,7 @@ Timer.prototype.makePlayButton = function() { setting.roundAmount = 90; setting.fontStyle.fontSize = 60; - // blue tone + // yellow setting.setStrokeColor( 0xd0d020, 0xb0b010, @@ -173,9 +174,9 @@ Timer.prototype.makePlayButton = function() { 0x666666 ); setting.setIconColor( - 0x906020, // 0x442211, - 0x704010, // 0x332200, - 0x502000, // 0x111100, + 0x906020, + 0x704010, + 0x502000, 0x333333 ); @@ -199,7 +200,7 @@ Timer.prototype.makePauseButton = function() { setting.fontStyle.fontSize = 40; setting.fontStyle.fontWeight = "bold"; - // gray tone + // gray setting.setStrokeColor( 0xa0a0a0, 0x808080,