Fix: typing ES5 bug
This commit is contained in:
@@ -1,33 +1,30 @@
|
||||
class ContentProgress {
|
||||
function ContentProgress() {
|
||||
let fontStyle = ContentProgress.DEFAULT_TEXT_FONT;
|
||||
|
||||
constructor() {
|
||||
let fontStyle = ContentProgress.DEFAULT_TEXT_FONT;
|
||||
fontStyle.align = "right";
|
||||
fontStyle.boundsAlignH = "right";
|
||||
this.typingSpeedText = game.add.text(game.world.width - 300, 0, "", fontStyle)
|
||||
.setTextBounds(0, 0, 200, ContentProgress.FONT_HEIGHT_PX);
|
||||
|
||||
fontStyle.align = "right";
|
||||
fontStyle.boundsAlignH = "right";
|
||||
this.typingSpeedText = game.add.text(game.world.width - 300, 0, "", fontStyle)
|
||||
.setTextBounds(0, 0, 200, ContentProgress.FONT_HEIGHT_PX);
|
||||
// var grd = this.label.context.createLinearGradient(0, 0, 0, ContentProgress.FONT_HEIGHT_PX);
|
||||
// grd.addColorStop(0, '#8ED6FF');
|
||||
// grd.addColorStop(1, '#004CB3');
|
||||
// this.label.fill = grd;
|
||||
// this.scoreText.fill = grd;
|
||||
|
||||
// var grd = this.label.context.createLinearGradient(0, 0, 0, ContentProgress.FONT_HEIGHT_PX);
|
||||
// grd.addColorStop(0, '#8ED6FF');
|
||||
// grd.addColorStop(1, '#004CB3');
|
||||
// this.label.fill = grd;
|
||||
// this.scoreText.fill = grd;
|
||||
// this.setShadow(3, 3, 'rgba(0, 0, 0, 0.5)', 2);
|
||||
// this.label.stroke = '#000';
|
||||
// this.label.strokeThickness = 3;
|
||||
};
|
||||
|
||||
// this.setShadow(3, 3, 'rgba(0, 0, 0, 0.5)', 2);
|
||||
// this.label.stroke = '#000';
|
||||
// this.label.strokeThickness = 3;
|
||||
};
|
||||
|
||||
print(playingNumber, totalCount) {
|
||||
if(playingNumber > totalCount)
|
||||
return;
|
||||
|
||||
this.typingSpeedText.text = playingNumber + " / " + totalCount;
|
||||
}
|
||||
ContentProgress.prototype.print = function(playingNumber, totalCount) {
|
||||
if(playingNumber > totalCount)
|
||||
return;
|
||||
|
||||
this.typingSpeedText.text = playingNumber + " / " + totalCount;
|
||||
}
|
||||
|
||||
|
||||
ContentProgress.FONT_HEIGHT_PX = 70;
|
||||
|
||||
ContentProgress.DEFAULT_TEXT_FONT = {
|
||||
|
||||
@@ -1,15 +1,38 @@
|
||||
class TypingContentBG {
|
||||
function TypingContentBG() {
|
||||
}
|
||||
|
||||
constructor() {
|
||||
TypingContentBG.prototype.makePracticeContentBG = function() {
|
||||
var CONTENT_Y = 140;
|
||||
|
||||
var bar = game.add.graphics();
|
||||
if(isKoreanTypingStage()) {
|
||||
bar.beginFill(TypingContentBG.COLOR_CONTENT_BG, 1);
|
||||
bar.drawRect(0, CONTENT_Y, GAME_SCREEN_SIZE.x, 120);
|
||||
} else {
|
||||
bar.beginFill(TypingContentBG.COLOR_CONTENT_BG, 1);
|
||||
bar.drawRect(0, CONTENT_Y, GAME_SCREEN_SIZE.x, 40);
|
||||
bar.beginFill(TypingContentBG.COLOR_CONTENT_ALPHABET_BG, 1);
|
||||
bar.drawRect(0, CONTENT_Y + 40, GAME_SCREEN_SIZE.x, 50);
|
||||
bar.beginFill(TypingContentBG.COLOR_CONTENT_BG, 1);
|
||||
bar.drawRect(0, CONTENT_Y + 90, GAME_SCREEN_SIZE.x, 30);
|
||||
}
|
||||
}
|
||||
|
||||
makePracticeContentBG() {
|
||||
let CONTENT_Y = 140;
|
||||
TypingContentBG.prototype.makeTestContentBG = function() {
|
||||
var CONTENT_Y = 260;
|
||||
|
||||
let bar = game.add.graphics();
|
||||
if(isKoreanTypingStage()) {
|
||||
var bar = game.add.graphics();
|
||||
if(isKoreanTypingStage()) {
|
||||
bar.beginFill(TypingContentBG.COLOR_CONTENT_BG, 1);
|
||||
bar.drawRect(0, CONTENT_Y, GAME_SCREEN_SIZE.x, 120);
|
||||
} else {
|
||||
if(isTypingSentenceStage()) {
|
||||
bar.beginFill(TypingContentBG.COLOR_CONTENT_BG, 1);
|
||||
bar.drawRect(0, CONTENT_Y, GAME_SCREEN_SIZE.x, 120);
|
||||
bar.drawRect(0, CONTENT_Y, GAME_SCREEN_SIZE.x, 46);
|
||||
bar.beginFill(TypingContentBG.COLOR_CONTENT_ALPHABET_BG, 1);
|
||||
bar.drawRect(0, CONTENT_Y + 46, GAME_SCREEN_SIZE.x, 30);
|
||||
bar.beginFill(TypingContentBG.COLOR_CONTENT_BG, 1);
|
||||
bar.drawRect(0, CONTENT_Y + 76, GAME_SCREEN_SIZE.x, 44);
|
||||
} else {
|
||||
bar.beginFill(TypingContentBG.COLOR_CONTENT_BG, 1);
|
||||
bar.drawRect(0, CONTENT_Y, GAME_SCREEN_SIZE.x, 40);
|
||||
@@ -19,34 +42,8 @@ class TypingContentBG {
|
||||
bar.drawRect(0, CONTENT_Y + 90, GAME_SCREEN_SIZE.x, 30);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
makeTestContentBG() {
|
||||
let CONTENT_Y = 260;
|
||||
|
||||
let bar = game.add.graphics();
|
||||
if(isKoreanTypingStage()) {
|
||||
bar.beginFill(TypingContentBG.COLOR_CONTENT_BG, 1);
|
||||
bar.drawRect(0, CONTENT_Y, GAME_SCREEN_SIZE.x, 120);
|
||||
} else {
|
||||
if(isTypingSentenceStage()) {
|
||||
bar.beginFill(TypingContentBG.COLOR_CONTENT_BG, 1);
|
||||
bar.drawRect(0, CONTENT_Y, GAME_SCREEN_SIZE.x, 46);
|
||||
bar.beginFill(TypingContentBG.COLOR_CONTENT_ALPHABET_BG, 1);
|
||||
bar.drawRect(0, CONTENT_Y + 46, GAME_SCREEN_SIZE.x, 30);
|
||||
bar.beginFill(TypingContentBG.COLOR_CONTENT_BG, 1);
|
||||
bar.drawRect(0, CONTENT_Y + 76, GAME_SCREEN_SIZE.x, 44);
|
||||
} else {
|
||||
bar.beginFill(TypingContentBG.COLOR_CONTENT_BG, 1);
|
||||
bar.drawRect(0, CONTENT_Y, GAME_SCREEN_SIZE.x, 40);
|
||||
bar.beginFill(TypingContentBG.COLOR_CONTENT_ALPHABET_BG, 1);
|
||||
bar.drawRect(0, CONTENT_Y + 40, GAME_SCREEN_SIZE.x, 50);
|
||||
bar.beginFill(TypingContentBG.COLOR_CONTENT_BG, 1);
|
||||
bar.drawRect(0, CONTENT_Y + 90, GAME_SCREEN_SIZE.x, 30);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
TypingContentBG.COLOR_CONTENT_BG = 0x444444;
|
||||
TypingContentBG.COLOR_CONTENT_ALPHABET_BG = 0x3d3d3d;
|
||||
@@ -1,40 +1,36 @@
|
||||
class TypingTextManager {
|
||||
function TypingTextManager() {
|
||||
this.init();
|
||||
}
|
||||
|
||||
constructor() {
|
||||
this.init();
|
||||
}
|
||||
TypingTextManager.prototype.init = function() {
|
||||
this.contents = [];
|
||||
}
|
||||
|
||||
init() {
|
||||
this.contents = [];
|
||||
}
|
||||
TypingTextManager.prototype.getContents = function() {
|
||||
return this.contents;
|
||||
}
|
||||
|
||||
getContents() {
|
||||
return this.contents;
|
||||
}
|
||||
TypingTextManager.prototype.add = function(arr) {
|
||||
this.contents = this.contents.concat(arr);
|
||||
}
|
||||
|
||||
add(arr) {
|
||||
this.contents = this.contents.concat(arr);
|
||||
}
|
||||
TypingTextManager.prototype.slice = function(start, end) {
|
||||
this.contents = this.contents.slice(start, end);
|
||||
}
|
||||
|
||||
slice(start, end) {
|
||||
this.contents = this.contents.slice(start, end);
|
||||
}
|
||||
TypingTextManager.prototype.getShuffledArray = function(arr) {
|
||||
return Phaser.ArrayUtils.shuffle(arr);
|
||||
}
|
||||
|
||||
getShuffledArray(arr) {
|
||||
return Phaser.ArrayUtils.shuffle(arr);
|
||||
}
|
||||
|
||||
|
||||
makePracticeContents(arr, repeatCount) {
|
||||
this.init();
|
||||
this.add(arr);
|
||||
for(let i = 0; i < repeatCount; i++) {
|
||||
this.add(this.getShuffledArray(arr));
|
||||
}
|
||||
}
|
||||
|
||||
makeTestContents(arr) {
|
||||
this.init();
|
||||
TypingTextManager.prototype.makePracticeContents = function(arr, repeatCount) {
|
||||
this.init();
|
||||
this.add(arr);
|
||||
for(var i = 0; i < repeatCount; i++) {
|
||||
this.add(this.getShuffledArray(arr));
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
TypingTextManager.prototype.makeTestContents = function(arr) {
|
||||
this.init();
|
||||
this.add(this.getShuffledArray(arr));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user