Files
chocomae/src/game/result/record_board.js
T
jisangs 1f5f87c361 Add: HistoryText
Fix: ranking.js, result.js
2019-06-09 00:21:03 +09:00

55 lines
1.5 KiB
JavaScript

function RecordBoard(dataType) {
this.chartGraphics = game.add.graphics(0, 0);
this.printRecordBoardHeader();
this.printSeperator(265, 480);
this.printSeperator(505, 480);
this.printSeperator(745, 480);
var historyBoard = new HistoryBoard(dataType);
var rankingBoard = new RankingBoard(dataType);
}
RecordBoard.prototype.printRecordBoardHeader = function() {
var posX = 40;
var 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);
var style = { font: "32px Arial", fill: "#ffc", align: "left", boundsAlignH: "center", boundsAlignV: "middle" };
this.printHeader(posX, posY, "최근의 내 기록", style);
posX = 285;
style.fill = "#fff";
this.printHeader(posX, posY, "수업시간 순위", style);
posX = 520;
this.printHeader(posX, posY, "오늘의 순위", style);
posX = 765;
this.printHeader(posX, posY, "이달의 순위", style);
}
RecordBoard.prototype.printHeader = function(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);
}
RecordBoard.prototype.printSeperator = function(x, y) {
this.chartGraphics.lineStyle(3, 0x444444, 1);
this.chartGraphics.moveTo(x, y);
this.chartGraphics.lineTo(x, y + 200);
}
RecordBoard.HEADER_BAR_HEIGHT_PX = 60;
RecordBoard.TYPE_SAMPLE = "sample";
RecordBoard.TYPE_DB = "db";
RecordBoard.DELAY_UPDATING_RESULT_RECORD_MS = 500;