From c0214b233b9fc9a1790a2a9a15357f15610a1bf2 Mon Sep 17 00:00:00 2001 From: Sergio Valor Date: Sun, 26 Apr 2026 10:47:41 +0200 Subject: [PATCH] =?UTF-8?q?fix(game-scene):=20text=20d'INTRO/OUTRO=20surt?= =?UTF-8?q?=20cap=20a=20la=20dreta=20despr=C3=A9s=20del=20hold?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/game/scenes/game_scene.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/source/game/scenes/game_scene.cpp b/source/game/scenes/game_scene.cpp index 7a52f92..04dd9df 100644 --- a/source/game/scenes/game_scene.cpp +++ b/source/game/scenes/game_scene.cpp @@ -545,7 +545,12 @@ void GameScene::renderRoomText() { constexpr int KERNING = 0; const int W = pause_font_->length(text, KERNING); + // El text entra des de l'esquerra (off-screen amb el seu cantó dret + // a x=0) i, després del hold, surt cap a la dreta (off-screen amb + // el seu cantó esquerre a x=WIDTH). Així el text "travessa" la + // pantalla en una sola direcció en compte de tornar enrere. const int OFF_LEFT = -W; + const int OFF_RIGHT = GameCanvas::WIDTH; int x = GameCanvas::CENTER_X; if (transition_.phase == phase_enter) { @@ -559,7 +564,7 @@ void GameScene::renderRoomText() { ? std::clamp(static_cast(transition_.elapsed_ms) / static_cast(dur_exit), 0.0F, 1.0F) : 1.0F; const auto CURVE = (transition_config_.text_exit_curve != nullptr) ? transition_config_.text_exit_curve : &Easing::linear; - x = Easing::lerpInt(GameCanvas::CENTER_X, OFF_LEFT, CURVE(T)); + x = Easing::lerpInt(GameCanvas::CENTER_X, OFF_RIGHT, CURVE(T)); } constexpr Uint8 OUTLINE_WHITE = 255;