Fix: font, font family
This commit is contained in:
@@ -74,10 +74,9 @@ var TypingExamination = {
|
||||
|
||||
var TYPING_CONTENT_X = 60;
|
||||
var TYPING_CONTENT_Y = 340;
|
||||
var RECORD_POSITION_X = 900;
|
||||
var RECORD_POSITION_X = 960;
|
||||
|
||||
var FONT_SIZE = 24;
|
||||
var BIG_FONT_SIZE = 32;
|
||||
var FONT_SIZE = 32;
|
||||
var TYPING_TEXT_OFFSET_HEIGHT = 40;
|
||||
|
||||
// textStyleBasic.font = "bold 38px Arial";
|
||||
@@ -85,6 +84,7 @@ var TypingExamination = {
|
||||
|
||||
|
||||
// current text
|
||||
textStyleBasic.font = "38px Courier New";
|
||||
this.textTypingContent = game.add.text(
|
||||
TYPING_CONTENT_X, TYPING_CONTENT_Y,
|
||||
"", textStyleBasic
|
||||
@@ -92,31 +92,33 @@ var TypingExamination = {
|
||||
.setShadow(3, 3, 'rgba(0, 0, 0, 0.5)', 2)
|
||||
.addColor(TypingExamination.COLOR_CONTENT_INPUT, 0);
|
||||
this.textTypingContent.anchor.set(0, 0.5);
|
||||
this.textTypingContent.fontSize = BIG_FONT_SIZE;
|
||||
this.textTypingContent.fontSize = FONT_SIZE;
|
||||
|
||||
textStyleBasic.font = "38px Arial";
|
||||
textStyleBasic.backgroundColor = null;
|
||||
this.textTypingLine = game.add.text(
|
||||
RECORD_POSITION_X, TYPING_CONTENT_Y,
|
||||
"", textStyleBasic
|
||||
)
|
||||
// .setShadow(3, 3, 'rgba(0, 0, 0, 0.5)', 2)
|
||||
.setShadow(3, 3, 'rgba(0, 0, 0, 0.5)', 2);
|
||||
// .addColor(TypingExamination.COLOR_CONTENT_INPUT, 0);
|
||||
this.textTypingLine.anchor.set(0.5);
|
||||
this.textTypingLine.anchor.set(1, 0.5);
|
||||
|
||||
|
||||
|
||||
var TYPING_OFFSET_Y = 70;
|
||||
var TYPING_PREVIEW_OFFSET_Y = 70;
|
||||
textStyleBasic.font = "38px Arial";
|
||||
// textStyleBasic.font = "38px Arial";
|
||||
textStyleBasic.backgroundColor = null;
|
||||
|
||||
|
||||
// done text
|
||||
// var textDoneColor = [ '#99994d', '#88884d', '#77774d', '#66664d' ];
|
||||
var textDoneColor = [ '#dddd4d', '#dddd4d', '#dddd4d', '#dddd4d' ];
|
||||
var textDoneColor = [ '#99994d', '#88884d', '#77774d', '#66664d' ];
|
||||
// var textDoneColor = [ '#99994d', '#99994d', '#99994d', '#99994d' ];
|
||||
this.textTypingContentsDone = [];
|
||||
this.textTypingRecordsDone = [];
|
||||
for(var i = 0; i < TypingExamination.TYPING_CONTENT_DONE_COUNT; i++) {
|
||||
textStyleBasic.font = "38px Courier New";
|
||||
this.textTypingContentsDone[i] = game.add.text(
|
||||
TYPING_CONTENT_X, TYPING_CONTENT_Y - TYPING_OFFSET_Y - i * TYPING_TEXT_OFFSET_HEIGHT,
|
||||
"", textStyleBasic
|
||||
@@ -126,21 +128,23 @@ var TypingExamination = {
|
||||
this.textTypingContentsDone[i].anchor.set(0, 0.5);
|
||||
this.textTypingContentsDone[i].fontSize = FONT_SIZE;
|
||||
|
||||
textStyleBasic.font = "38px Arial";
|
||||
this.textTypingRecordsDone[i] = game.add.text(
|
||||
RECORD_POSITION_X, TYPING_CONTENT_Y - TYPING_OFFSET_Y - i * TYPING_TEXT_OFFSET_HEIGHT,
|
||||
"", textStyleBasic
|
||||
)
|
||||
.setShadow(3, 3, 'rgba(0, 0, 0, 0.5)', 2)
|
||||
.addColor(textDoneColor[i], 0);
|
||||
this.textTypingRecordsDone[i].anchor.set(0.5);
|
||||
this.textTypingRecordsDone[i].anchor.set(1, 0.5);
|
||||
this.textTypingRecordsDone[i].fontSize = FONT_SIZE;
|
||||
}
|
||||
|
||||
// preview text
|
||||
// var textPreviewColor = [ '#999999', '#888888', '#777777', '#666666' ];
|
||||
var textPreviewColor = [ '#dddddd', '#dddddd', '#dddddd', '#dddddd' ];
|
||||
var textPreviewColor = [ '#999999', '#888888', '#777777', '#666666' ];
|
||||
// var textPreviewColor = [ '#999999', '#999999', '#999999', '#999999' ];
|
||||
this.textTypingContentPreview = [];
|
||||
for(var i = 0; i < TypingExamination.TYPING_CONTENT_PREVIEW_COUNT; i++) {
|
||||
textStyleBasic.font = "38px Courier New";
|
||||
this.textTypingContentPreview[i] = game.add.text(
|
||||
TYPING_CONTENT_X,
|
||||
TYPING_CONTENT_Y + TYPING_OFFSET_Y + TYPING_PREVIEW_OFFSET_Y + i * TYPING_TEXT_OFFSET_HEIGHT,
|
||||
@@ -154,11 +158,14 @@ var TypingExamination = {
|
||||
|
||||
|
||||
// input text
|
||||
this.inputTextContent = new InputTypeText(TYPING_CONTENT_X - 10, TYPING_CONTENT_Y + 70);
|
||||
this.inputTextContent = new InputText(TYPING_CONTENT_X - 10, TYPING_CONTENT_Y + 70, 800, 50);
|
||||
this.inputTextContent.anchor.set(0, 0.5);
|
||||
this.inputTextContent.canvasInput.value('');
|
||||
this.inputTextContent.canvasInput.focus();
|
||||
this.inputTextContent.canvasInput.fontSize(BIG_FONT_SIZE);
|
||||
this.inputTextContent.canvasInput.fontSize(FONT_SIZE);
|
||||
// this.inputTextContent.canvasInput.fontWeight("");
|
||||
this.inputTextContent.canvasInput.fontFamily("Courier New");
|
||||
// this.inputTextContent.canvasInput.fontFamily("Courier New");
|
||||
this.inputTextContent.canvasInput.placeHolder("");
|
||||
// inputTextContent.canvasInput._onkeydown = this.checkInputText;
|
||||
// inputTextContent.canvasInput._onkeyup = function() {
|
||||
|
||||
Reference in New Issue
Block a user