Add: RecordUtil
This commit is contained in:
@@ -126,23 +126,22 @@ RankingBoard.prototype.printRecord = function(type, index, data) {
|
||||
var style = { font: "20px Arial", fill: "#fff", align: "right", boundsAlignH: "right", boundsAlignV: "top" };
|
||||
|
||||
// rank
|
||||
style.boundsAlignH = "right";
|
||||
// style.boundsAlignH = "right";
|
||||
var rankText = game.add.text(this.getPosX(type), this.getPosY(index), data.rank, style);
|
||||
// .setTextBounds(0, 0, 40, 40)
|
||||
rankText.anchor.set(1, 0);
|
||||
rankText.setShadow(3, 3, 'rgba(0, 0, 0, 0.5)', 2);
|
||||
|
||||
// player name
|
||||
var playerNameText = game.add.text(this.getPosX(type) + 20, this.getPosY(index), data.playerName, style);
|
||||
// .setTextBounds(0, 0, 60, 60)
|
||||
playerNameText.anchor.set(0, 0);
|
||||
playerNameText.setShadow(3, 3, 'rgba(0, 0, 0, 0.5)', 2);
|
||||
|
||||
// bestRecord
|
||||
var bestRecord = StringUtil.getRecordTextWithoutUnit(data.bestRecord);
|
||||
style.boundsAlignH = "right";
|
||||
var recordText = game.add.text(this.getPosX(type) + 180, this.getPosY(index), bestRecord, style);
|
||||
// .setTextBounds(0, 0, 80, 60)
|
||||
var recordText = game.add.text(
|
||||
this.getPosX(type) + 180, this.getPosY(index),
|
||||
RecordUtil.getRecordValueWithUnit(data.bestRecord, sessionStorageManager.getPlayingAppID()),
|
||||
style
|
||||
);
|
||||
recordText.anchor.set(1, 0);
|
||||
recordText.setShadow(3, 3, 'rgba(0, 0, 0, 0.5)', 2);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user