39 lines
1.0 KiB
JavaScript
39 lines
1.0 KiB
JavaScript
class ContentProgress {
|
|
|
|
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);
|
|
|
|
// 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;
|
|
};
|
|
|
|
print(playingNumber, totalCount) {
|
|
if(playingNumber > totalCount)
|
|
return;
|
|
|
|
this.typingSpeedText.text = playingNumber + " / " + totalCount;
|
|
}
|
|
|
|
}
|
|
|
|
ContentProgress.FONT_HEIGHT_PX = 70;
|
|
|
|
ContentProgress.DEFAULT_TEXT_FONT = {
|
|
font: "38px Arial",
|
|
align: "center",
|
|
boundsAlignH: "center", // left, center. right
|
|
boundsAlignV: "middle", // top, middle, bottom
|
|
fill: "#fff"
|
|
}; |