fix(game-scene): text d'INTRO/OUTRO surt cap a la dreta després del hold
This commit is contained in:
1 parent
d054d1b246
commit
c0214b233b
1 file changed
+6
-1
@@ -545,7 +545,12 @@ void GameScene::renderRoomText() {
|
|||||||
|
|
||||||
constexpr int KERNING = 0;
|
constexpr int KERNING = 0;
|
||||||
const int W = pause_font_->length(text, KERNING);
|
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_LEFT = -W;
|
||||||
|
const int OFF_RIGHT = GameCanvas::WIDTH;
|
||||||
int x = GameCanvas::CENTER_X;
|
int x = GameCanvas::CENTER_X;
|
||||||
|
|
||||||
if (transition_.phase == phase_enter) {
|
if (transition_.phase == phase_enter) {
|
||||||
@@ -559,7 +564,7 @@ void GameScene::renderRoomText() {
|
|||||||
? std::clamp(static_cast<float>(transition_.elapsed_ms) / static_cast<float>(dur_exit), 0.0F, 1.0F)
|
? std::clamp(static_cast<float>(transition_.elapsed_ms) / static_cast<float>(dur_exit), 0.0F, 1.0F)
|
||||||
: 1.0F;
|
: 1.0F;
|
||||||
const auto CURVE = (transition_config_.text_exit_curve != nullptr) ? transition_config_.text_exit_curve : &Easing::linear;
|
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;
|
constexpr Uint8 OUTLINE_WHITE = 255;
|
||||||
|
|||||||
Reference in new issue
Block a user