Fix: apply Nanum Coding font, change animal(incompleted)

This commit is contained in:
2019-08-18 18:32:06 +09:00
parent 6698a71aaf
commit 7a4197689e
3 changed files with 46 additions and 47 deletions
+34 -43
View File
@@ -1,32 +1,17 @@
TypingExamination.prototype = Object.create(Phaser.State.prototype);
TypingExamination.constructor = TypingExamination;
TypingExamination.GAME_TIME_SEC = 60 * 5; // 5 minutes
TypingExamination.SPACE_INDICATOR = "ˇ"; // "ᵔ"; // "ᵕ"; // "ˣ"; // "ᵛ"; // " · ";
TypingExamination.TYPING_CONTENT_PREVIEW_COUNT = 4; // 3;
TypingExamination.TYPING_CONTENT_DONE_COUNT = 4; // 3;
TypingExamination.TYPING_COUNT_PLUS_ENTER = 1;
TypingExamination.OFFSET_RIGHT_ALIGN = 10;
TypingExamination.WORD_COUNT_FOR_STAGE = 10;
TypingExamination.COLOR_CONTENT_INPUT = "#dddddd";
TypingExamination.COLOR_CONTENT_RIGHT = "#ffff4d";
TypingExamination.STAGE_BACKGROUND_COLOR = "#4d4d4d";
TypingExamination.INPUT_CONTENT_BACKGROUND_COLOR = "#333333";
TypingExamination.STAGE_BACKGROUND_COLOR_HEX = 0x4d4d4d;
TypingExamination.INPUT_CONTENT_BACKGROUND_COLOR_HEX = 0x333333;
function TypingExamination() {
}
TypingExamination.prototype.preload = function() {
game.load.image('icon_fullscreen', '../../../resources/image/icon/fullscreen_white.png');
Animal.loadResources();
game.load.script('webfont', '//ajax.googleapis.com/ajax/libs/webfont/1.4.7/webfont.js');
}
TypingExamination.prototype.create = function() {
// for developing
// sessionStorageManager.setMaestroName("삼화초");
@@ -75,8 +60,21 @@ TypingExamination.prototype.create = function() {
this.averageTypingSpeedText = new AverageTypingSpeed();
// bottom ui
var screenBottomUI = new ScreenBottomUI();
screenBottomUI.printLeftTextWithAppHighestRecord(sessionStorageManager.getAppHighestRecord());
screenBottomUI.printCenterText(sessionStorageManager.getPlayingAppKoreanName());
screenBottomUI.printRightText(sessionStorageManager.getPlayerName());
// this.countDown();
}
TypingExamination.prototype.fontLoaded = function() {
// this.animalList = new AnimalList(90);
this.makeAnimalRecordList();
// this.animalRecordList.hide();
this.animalRecordList.applyLoadedFont();
this.animalList = new AnimalList(90);
// typing content
var CONTENT_TEXT_WIDTH = 800;
@@ -89,7 +87,7 @@ TypingExamination.prototype.create = function() {
var TYPING_CONTENT_X = 50;
var TYPING_CONTENT_Y = 390;
var TYPING_CONTENT_Y = 320; // 390;
var RECORD_POSITION_X = 990;
var INPUT_TEXT_OFFSET_X = 10;
@@ -104,7 +102,7 @@ TypingExamination.prototype.create = function() {
// current text
textStyleBasic.font = "38px Courier New";
textStyleBasic.font = "38px Nanum Gothic Coding";
this.textTypedContentBack = game.add.text(
TYPING_CONTENT_X, TYPING_CONTENT_Y,
"", textStyleBasic
@@ -177,7 +175,7 @@ TypingExamination.prototype.create = function() {
TYPING_CONTENT_Y - TYPING_OFFSET_Y - i * TYPING_TEXT_OFFSET_HEIGHT + CONTENT_UNDERLINE_OFFSET
);
textStyleBasic.font = "38px Courier New";
textStyleBasic.font = "38px Nanum Gothic Coding";
this.textTypingContentsDone[i] = game.add.text(
TYPING_CONTENT_X, TYPING_CONTENT_Y - TYPING_OFFSET_Y - i * TYPING_TEXT_OFFSET_HEIGHT,
"", textStyleBasic
@@ -212,7 +210,7 @@ TypingExamination.prototype.create = function() {
TYPING_CONTENT_Y + TYPING_OFFSET_Y + TYPING_PREVIEW_OFFSET_Y + i * TYPING_TEXT_OFFSET_HEIGHT + CONTENT_UNDERLINE_OFFSET
);
textStyleBasic.font = "38px Courier New";
textStyleBasic.font = "38px Nanum Gothic Coding";
this.textTypingContentPreview[i] = game.add.text(
TYPING_CONTENT_X,
TYPING_CONTENT_Y + TYPING_OFFSET_Y + TYPING_PREVIEW_OFFSET_Y + i * TYPING_TEXT_OFFSET_HEIGHT,
@@ -236,8 +234,8 @@ TypingExamination.prototype.create = function() {
this.inputTextContent.canvasInput.focus();
this.inputTextContent.canvasInput.fontSize(BIG_FONT_SIZE);
// this.inputTextContent.canvasInput.fontWeight("");
this.inputTextContent.canvasInput.fontFamily("Courier New");
// this.inputTextContent.canvasInput.fontFamily("Courier New");
this.inputTextContent.canvasInput.fontFamily("Nanum Gothic Coding");
// this.inputTextContent.canvasInput.fontFamily("Nanum Gothic Coding");
this.inputTextContent.canvasInput.placeHolder("");
// inputTextContent.canvasInput._onkeydown = this.checkInputText;
// inputTextContent.canvasInput._onkeyup = function() {
@@ -247,17 +245,7 @@ TypingExamination.prototype.create = function() {
// : checkTypingContents is called onkeyup and onkeydown
}).bind(this);
// bottom ui
var screenBottomUI = new ScreenBottomUI();
screenBottomUI.printLeftTextWithAppHighestRecord(sessionStorageManager.getAppHighestRecord());
screenBottomUI.printCenterText(sessionStorageManager.getPlayingAppKoreanName());
screenBottomUI.printRightText(sessionStorageManager.getPlayerName());
this.loadExaminationContent();
// this.countDown();
}
/*
@@ -291,6 +279,11 @@ tweenCountDown() {
}
*/
TypingExamination.prototype.makeAnimalRecordList = function() {
this.animalRecordList = new AnimalRecordList(AnimalRecordList.TYPE_MENU);
this.animalRecordList.printScore(Animal.TYPE_PRACTICE);
}
TypingExamination.prototype.back = function() {
sessionStorageManager.resetPlayingAppData();
@@ -629,7 +622,6 @@ TypingExamination.prototype.setTimeTypingStart = function() {
}
/*
TypingExamination.GAME_TIME_SEC = 60 * 5; // 5 minutes
TypingExamination.SPACE_INDICATOR = "ˇ"; // "ᵔ"; // "ᵕ"; // "ˣ"; // "ᵛ"; // " · ";
@@ -648,5 +640,4 @@ TypingExamination.COLOR_CONTENT_RIGHT = "#ffff4d";
TypingExamination.STAGE_BACKGROUND_COLOR = "#4d4d4d";
TypingExamination.INPUT_CONTENT_BACKGROUND_COLOR = "#333333";
TypingExamination.STAGE_BACKGROUND_COLOR_HEX = 0x4d4d4d;
TypingExamination.INPUT_CONTENT_BACKGROUND_COLOR_HEX = 0x333333;
*/
TypingExamination.INPUT_CONTENT_BACKGROUND_COLOR_HEX = 0x333333;