Add: HistoryText

Fix: ranking.js, result.js
This commit is contained in:
2019-06-09 00:21:03 +09:00
parent 547fee6704
commit 1f5f87c361
8 changed files with 127 additions and 72 deletions
+9 -23
View File
@@ -4,17 +4,18 @@ function HistoryBoard(dataType) {
return;
}
var rankingTextOffsetY = game.world.height / 2 + 105;
this.historyTexts = new Array();
for(var i = 0; i < RankingBoard.RANK_COUNT; i++) {
var posY = rankingTextOffsetY + (i % 10) * 30;
this.historyTexts[i] = new HistoryText(80, posY);
}
this.todayBestRecord = 0;
this.dbConnectManager = new DBConnectManager();
var arrayTabStyle = { font: "20px Arial", fill: "#fff", align: "left", tabs: [ 40, 80, 120 ] };
var posX = 40;
var posY = game.world.height / 2 - 10;
this.textMyRanking = game.add.text(posX, posY + 100, '', arrayTabStyle)
.setShadow(3, 3, 'rgba(0, 0, 0, 0.5)', 2);
setTimeout(
(function() {
var today = new Date();
@@ -51,22 +52,7 @@ HistoryBoard.prototype.calcDate = function(daysBefore) {
HistoryBoard.prototype.printRecord = function(index, date, bestRecord) {
var posX = 130;
var posY = game.world.height / 2 + 90 + 30 * index;
var style = { font: "20px Arial", fill: "#ffc", align: "right", boundsAlignH: "right", boundsAlignV: "top" };
var dateText = game.add.text(posX, posY, StringUtil.printMonthDay(date), style);
dateText.setShadow(3, 3, 'rgba(0, 0, 0, 0.5)', 2);
dateText.anchor.set(1, 0);
var recordText = game.add.text(
posX + 120, posY,
RecordUtil.getRecordValueWithUnit(bestRecord, sessionStorageManager.getPlayingAppID()),
style
);
recordText.anchor.set(1, 0);
recordText.setShadow(3, 3, 'rgba(0, 0, 0, 0.5)', 2);
this.historyTexts[index].setContents(date, bestRecord);
}
HistoryBoard.prototype.printSample = function() {