diff --git a/src/game/license_timer/game.js b/src/game/license_timer/game.js index 46fda46..bbd81dd 100644 --- a/src/game/license_timer/game.js +++ b/src/game/license_timer/game.js @@ -1,6 +1,10 @@ var LicenseTimer = { create: function() { + Phaser.Device.whenReady(function () { + game.plugins.add(PhaserInput.Plugin); + }); + game.stage.backgroundColor = '#4d4d4d'; this.initVariables(); @@ -23,6 +27,44 @@ var LicenseTimer = { this.titleText = game.add.text(game.world.centerX, 35, "자격증 타이머", titleTextStyle); this.titleText.anchor.set(0.5); + + + this.fullscreenButton = new FullscreenButton(); + + + var btnTexture = new Phaser.Graphics() + .beginFill(0xffffff) + .drawRoundedRect(0, 0, 200, 60, 5) + .endFill() + .generateTexture(); + + // return game.add.sprite(0, 0, btnTexture); + game.add.sprite( + game.world.centerX - 85, game.world.centerY, + btnTexture + ); + + this.subjectInputText = game.add.inputField(game.world.centerX - 85, game.world.centerY, { + font: '32px Arial', + fill: '#212121', + fillAlpha: 0, + fontWeight: "", //'bold', + // forceCase: PhaserInput.ForceCase.upper, + width: 200, + max: 100, + padding: 8, + borderWidth: 1, + borderColor: '#000', + borderRadius: 6, + placeHolder: '과목 입력', + textAlign: 'center', + zoom: true + }); + this.subjectInputText.setText(''); + this.subjectInputText.blockInput = false; + + + this.makeTimer(); this.makeInputScoreGroup(); @@ -222,14 +264,13 @@ var LicenseTimer = { var set60SecButton = new RoundRectButton( setting, null, "저장", - (function() { console.log("save score"); }).bind(this) + (function() { console.log(this.subjectInputText.value); console.log("save score"); }).bind(this) ); }, setInputTextWidth(inputText, width) { inputText.canvasInput.width = width; - console.log(inputText.canvasInput); inputText.canvasInput._shadowCanvas.setAttribute('width', self._width + self._padding * 2); inputText.canvasInput._hiddenInput.style.width = self._width + 'px'; diff --git a/src/web/client/license_timer.html b/src/web/client/license_timer.html index 22bee57..ce1d756 100644 --- a/src/web/client/license_timer.html +++ b/src/web/client/license_timer.html @@ -31,6 +31,7 @@ +