Fix: start graph with db data

This commit is contained in:
2018-05-17 19:11:13 +09:00
parent 235327cd3e
commit 7046958cb7
+7 -2
View File
@@ -76,12 +76,17 @@ class Start {
const CHART_GAP_PX = 120; const CHART_GAP_PX = 120;
const style = { font: "32px Arial", fill: "#fff", align: "left", boundsAlignH: "center", boundsAlignV: "middle" }; const style = { font: "32px Arial", fill: "#fff", align: "left", boundsAlignH: "center", boundsAlignV: "middle" };
let dateText = game.add.text(100 + index * CHART_GAP_PX, game.world.height - 140, date, style); let dateTime = new Date(date);
console.log(dateTime);
console.log((dateTime.getMonth() + 1) + "월 " + dateTime.getDate() + "일");
let monthDay = (dateTime.getMonth() + 1) + "월 " + dateTime.getDate() + "일";
let dateText = game.add.text(100 + index * CHART_GAP_PX, game.world.height - 140, monthDay, style);
dateText.setTextBounds(0, 0, 100, 100); dateText.setTextBounds(0, 0, 100, 100);
dateText.stroke = "#333"; dateText.stroke = "#333";
dateText.strokeThickness = 1; dateText.strokeThickness = 1;
let numberWithCommas = NumberUtil.numberWithCommas(score); let numberWithCommas = NumberUtil.numberWithCommas(Math.floor(score));
let scoreText = game.add.text(100 + index * CHART_GAP_PX, game.world.height - 300, numberWithCommas, style); let scoreText = game.add.text(100 + index * CHART_GAP_PX, game.world.height - 300, numberWithCommas, style);
scoreText.setTextBounds(0, 0, 100, 100); scoreText.setTextBounds(0, 0, 100, 100);
scoreText.stroke = "#333"; scoreText.stroke = "#333";