feat(intro/outro): rètol centrat sobre el playfield i ajustos de timings/colors

This commit is contained in:
JailDesigner committed 2026-04-26 18:08:02 +02:00
1 parent 98303f7ce8
commit 0752df0f62
5 files changed
+15 -10

No files matched your search

+2 -2
View File
@@ -2,7 +2,7 @@
# Generado con font_gen.py
box_width 18
box_height 30
box_height 28
columns 15
# codepoint_decimal ancho_visual
@@ -116,7 +116,7 @@ columns 15
224 13 # à
225 13 # á
232 10 # è
233 10 # é
233 11 # é
236 7 # ì
237 8 # í
242 13 # ò
Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 3.6 KiB

+2 -2
View File
@@ -10,14 +10,14 @@ room_intro:
text_enter_ms: 400 # text esquerra → centre
text_hold_ms: 1500 # text quiet al centre
text_exit_ms: 400 # text centre → fora per l'esquerra
line_gap_px: 0 # px extra entre les dues línies (piràmide / sala)
line_gap_px: -4 # px extra entre les dues línies (piràmide / sala)
room_outro:
text_enter_ms: 400
text_hold_ms: 1500
text_exit_ms: 400
fade_out_ms: 500 # món visible → negre opac
line_gap_px: 0 # px extra entre les dues línies (fase / completada)
line_gap_px: -4 # px extra entre les dues línies (fase / completada)
black_hold_ms: 500 # pausa en negre abans d'entrar a la pròxima sala
text:
+2 -2
View File
@@ -24,8 +24,8 @@ colors:
# de notification_* perquè la fase i les notificacions són dos canals
# visuals distints: ací pots canviar el color del rètol sense tocar
# els missatges del HUD.
room_text: 232
room_text_outline: 255
room_text: 160
room_text_outline: 253
timings:
notification_ms: 4000
+9 -4
View File
@@ -657,6 +657,11 @@ void GameScene::renderRoomText() {
// de les dues.
if (!room_text_font_) { return; }
// Centre vertical de la zona de joc (canvas sense la HUD). Reemplaça
// l'antic GameCanvas::CENTER_Y per descomptar la franja del marcador
// i tenir el rètol equilibrat sobre el playfield.
const int PLAY_CENTER_Y = (GameCanvas::HEIGHT + Map::hud_h) / 2;
constexpr int KERNING = 0;
constexpr Uint8 STROKE_DIST = 1;
// Colors del rètol via UiConfig — abans el contorn estava
@@ -725,8 +730,8 @@ void GameScene::renderRoomText() {
// sumem cap avall a la sala, mantenint el centre del bloc fix.
const int LINE_HEIGHT = room_text_font_->getLineHeight();
const int GAP = transition_config_.intro_text_line_gap_px;
const int Y_PYRAMID = GameCanvas::CENTER_Y - LINE_HEIGHT - (GAP / 2);
const int Y_ROOM = GameCanvas::CENTER_Y + (GAP / 2);
const int Y_PYRAMID = PLAY_CENTER_Y - LINE_HEIGHT - (GAP / 2);
const int Y_ROOM = PLAY_CENTER_Y + (GAP / 2);
draw_line(LINE_PYRAMID, X_PYRAMID, Y_PYRAMID);
draw_line(LINE_ROOM, X_ROOM, Y_ROOM);
} else if (state_ == RoomFsm::State::ROOM_OUTRO && transition_.phase >= 0 && transition_.phase <= 2) {
@@ -743,8 +748,8 @@ void GameScene::renderRoomText() {
const int X_2 = compute_x(W_2, 0, 2, DUR_ENTER, DUR_EXIT, /*from_right=*/true);
const int LINE_HEIGHT = room_text_font_->getLineHeight();
const int GAP = transition_config_.outro_text_line_gap_px;
const int Y_1 = GameCanvas::CENTER_Y - LINE_HEIGHT - (GAP / 2);
const int Y_2 = GameCanvas::CENTER_Y + (GAP / 2);
const int Y_1 = PLAY_CENTER_Y - LINE_HEIGHT - (GAP / 2);
const int Y_2 = PLAY_CENTER_Y + (GAP / 2);
draw_line(LINE_1, X_1, Y_1);
draw_line(LINE_2, X_2, Y_2);
}