Files
chocomae/src/game/result/record_board.js
T

56 lines
1.3 KiB
JavaScript

/////////////////////////////
// Record board
class RecordBoard {
constructor() {
this.chartGraphics = game.add.graphics(0, 0);
this.printRecordBoardHeader();
this.printSeperator();
let historyBoard = new HistoryBoard();
let rankingBoard = new RankingBoard();
}
printRecordBoardHeader() {
let posX = 60;
let posY = game.world.height / 2 + 20;
var bar = game.add.graphics();
bar.beginFill(0x444444);
bar.drawRect(0, posY, game.world.width, RecordBoard.HEADER_BAR_HEIGHT_PX);
const style = { font: "32px Arial", fill: "#ffc", align: "left", boundsAlignH: "center", boundsAlignV: "middle" };
this.printHeader(posX, posY, "최근의 내 기록", style);
posX = 320;
style.fill = "#fff";
this.printHeader(posX, posY, "수업시간 순위", style);
posX = 550;
this.printHeader(posX, posY, "오늘의 순위", style);
posX = 770;
this.printHeader(posX, posY, "이달의 순위", style);
}
printHeader(x, y, title, style) {
game.add.text(x, y, title, style)
.setTextBounds(0, 0, 200, RecordBoard.HEADER_BAR_HEIGHT_PX)
.setShadow(3, 3, 'rgba(0, 0, 0, 0.5)', 2);
}
printSeperator() {
const posX = 290;
const posY = 480;
this.chartGraphics.lineStyle(3, 0x444444, 1);
this.chartGraphics.moveTo(posX, posY);
this.chartGraphics.lineTo(posX, posY + 200);
}
}
RecordBoard.HEADER_BAR_HEIGHT_PX = 60;