Add: timer buttons - clear, play, pause

This commit is contained in:
2018-12-10 22:07:26 +09:00
parent e84248106a
commit 6becc05aab
3 changed files with 186 additions and 42 deletions
+23 -20
View File
@@ -15,39 +15,42 @@ function InputScore(chart) {
bar.drawRect(0, inputScorePosY, GAME_SCREEN_SIZE.x, 70);
var subjectTextSetting = this.makeInputTextSetting(300, "과목 입력");
this.subjectText = this.makeInputText(20, inputScorePosY + 10, subjectTextSetting);
// contents
var setting = new RoundRectButtonSetting(0, 0, 0, 0);
setting.strokeWidthPx = 5;
setting.x = 60;
setting.y = inputScorePosY + 35;
setting.width = 100;
setting.height = 50;
setting.fontStyle.fontSize = 24;
this.subjectButton = new RoundRectButton(
setting,
null, "과목",
(function() { console.log("과목 선택"); }).bind(this)
);
var subjectTextSetting = this.makeInputTextSetting(280, "과목 입력");
this.subjectText = this.makeInputText(120, inputScorePosY + 10, subjectTextSetting);
this.subjectText.setText(this.subject);
var setting = new RoundRectButtonSetting(0, 0, 0, 0);
setting.fontStyle.boundsAlignH = "left"; // left, center. right
setting.fontStyle.boundsAlignV = "middle"; // top, middle, bottom
setting.strokeWidthPx = 5;
var titleTextStyle = { font: "36px Arial", fill: "#fff", align: "center"};
this.titleText = game.add.text(350, inputScorePosY + 40, "과목", titleTextStyle);
this.titleText = game.add.text(440, inputScorePosY + 40, "점수", titleTextStyle);
this.titleText.anchor.set(0, 0.5);
// subject input text
// var inputTextSetting = this.makeInputTextSetting(200, "점수 입력");
var recordTextSetting = this.makeInputTextSetting(150, "점수 입력");
this.recordText = this.makeInputText(game.world.centerX - 50, inputScorePosY + 10, recordTextSetting);
// this.subjectText.setText(this.subject);
this.recordText = this.makeInputText(game.world.centerX, inputScorePosY + 10, recordTextSetting);
this.titleText = game.add.text(640, inputScorePosY + 40, "", titleTextStyle);
this.titleText = game.add.text(game.world.centerX + 190, inputScorePosY + 40, "마에", titleTextStyle);
this.titleText.anchor.set(0, 0.5);
var passwordTextSetting = this.makeInputTextSetting(150, "비밀번호");
var passwordTextSetting = this.makeInputTextSetting(110, "비밀번호");
passwordTextSetting.type = PhaserInput.InputType.password;
this.passwordText = this.makeInputText(GAME_SCREEN_SIZE.x - 330, inputScorePosY + 10, passwordTextSetting);
this.passwordText = this.makeInputText(game.world.centerX + 260, inputScorePosY + 10, passwordTextSetting);
// set timer buttons
setting.x = GAME_SCREEN_SIZE.x - 80;
setting.x = GAME_SCREEN_SIZE.x - 60;
setting.y = inputScorePosY + 35;
setting.width = 100;
setting.height = 50;