function RecordBoard(dataType) { this.chartGraphics = game.add.graphics(0, 0); this.printRecordBoardHeader(); this.printSeperator(); var historyBoard = new HistoryBoard(dataType); var rankingBoard = new RankingBoard(dataType); } RecordBoard.prototype.printRecordBoardHeader = function() { var posX = 60; 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 = 320; style.fill = "#fff"; this.printHeader(posX, posY, "수업시간 순위", style); posX = 550; this.printHeader(posX, posY, "오늘의 순위", style); posX = 770; 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() { var posX = 290; var 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; RecordBoard.TYPE_SAMPLE = "sample"; RecordBoard.TYPE_DB = "db"; RecordBoard.DELAY_UPDATING_RESULT_RECORD_MS = 500;