DX: pantalla de record amb marc, asteriscos i centrat vertical

This commit is contained in:
2026-05-15 21:54:59 +02:00
parent 380cab4176
commit e8340472f8
2 changed files with 27 additions and 12 deletions
+1 -1
View File
@@ -71,7 +71,7 @@ textos = {
lives_label = "Vides",
record_label = "Record",
name_label = "Nom:",
name_help = "(A-Z)",
name_help = "Tecles A-Z",
}
-- ====================================================================
+26 -11
View File
@@ -719,18 +719,33 @@ end
function update_entername()
set_music("entername")
neteja_fons()
color(colors.title, colors.bg)
local t = textos.new_record
print(t, flr((40 - strlen(t)) / 2), 10)
color(colors.diners, colors.bg)
local s = textos.score_label.." "..string.format("%03d", hi_score)
print(s, flr((40 - strlen(s)) / 2), 12)
color(COLOR_WHITE, colors.bg)
local n = textos.name_label.." "..nom_hi_score
print(n, flr((40 - strlen(n)) / 2), 15)
print(textos.name_help, flr((40 - strlen(textos.name_help)) / 2), 17)
pintar_hud()
-- Titol amb asteriscos a banda i banda per a donar "feel" arcade
color(colors.title, colors.bg)
local t = "* * "..textos.new_record.." * *"
print(t, flr((40 - strlen(t)) / 2), 10)
-- Puntuacio amb dos punts (consistencia amb "Nom:")
color(colors.diners, colors.bg)
local s = textos.score_label..": "..string.format("%03d", hi_score)
print(s, flr((40 - strlen(s)) / 2), 12)
-- Bloc del nom dins d'un marc decoratiu (reutilitzem els FRAME_* del HUD)
color(COLOR_WHITE, colors.bg)
local n = textos.name_label.." "..nom_hi_score -- "Nom: AAA"
local inner_w = strlen(n) + 2 -- 1 espai de padding cada costat
local frame_w = inner_w + 2 -- + 2 esquines
local frame_x = flr((40 - frame_w) / 2)
local top = chr(FRAME_TL)..string.rep(chr(FRAME_H), inner_w)..chr(FRAME_TR)
local mid = chr(FRAME_V).." "..n.." "..chr(FRAME_V)
local bot = chr(FRAME_BL)..string.rep(chr(FRAME_H), inner_w)..chr(FRAME_BR)
print(top, frame_x, 15)
print(mid, frame_x, 16)
print(bot, frame_x, 17)
-- Ajuda just sota el marc — 10 chars = exactament l'amplada interna del
-- marc (cols 15-24), per a evitar l'asimetria del "(A-Z)" original.
print(textos.name_help, flr((40 - strlen(textos.name_help)) / 2), 18)
if fade_actiu() then return end