* more changes to leaderboard

This commit is contained in:
FajsiEx 2021-11-27 22:30:44 +01:00
parent 5152d2e0b4
commit c20a8d0676
1 changed files with 8 additions and 5 deletions

View File

@ -26,21 +26,25 @@ local drawScoreboard = function (users, currentUserId)
gfx.FillColor(255,255,255);
end
gfx.FontSize(26)
gfx.Text('#' .. i .. ' ' .. u.name, x, y)
gfx.FontSize(26)
gfx.TextAlign(gfx.TEXT_ALIGN_LEFT + gfx.TEXT_ALIGN_MIDDLE)
gfx.Text(string.format("%04d", math.floor(u.score/10000)), x+128+32, y)
gfx.Text(string.format("%04d", math.floor(u.score/10000)), x, y)
local lastFourDigits = ((u.score / 10000) - math.floor(u.score / 10000))*10000
gfx.FontSize(22)
gfx.Text(string.format("%04d", math.floor(lastFourDigits)), x+186+32, y+1)
gfx.Text(string.format("%04d", math.floor(lastFourDigits)), x+58, y+1)
gfx.FontSize(26)
gfx.Text('#' .. i .. ' ' .. u.name, x+120, y)
end
end
local render = function (deltaTime, users, currentUserId)
local resx, resy = game.GetResolution();
drawScoreboard(users, currentUserId); -- TODO: for now
if (resx > resy) then
return
end
@ -60,7 +64,6 @@ local render = function (deltaTime, users, currentUserId)
0
);
drawScoreboard(users, currentUserId);
end
return {