feat(title): cosmètics i posicions a YAML, font Tiny5 al copyright
This commit is contained in:
1 parent
233fcb8226
commit
fceeb11cdd
12 files changed
+211
-163
No files matched your search
@@ -32,11 +32,6 @@ namespace {
|
||||
// docs/audit-core-rendering.md).
|
||||
const char* const SCENE_NAME = "TITLE";
|
||||
|
||||
constexpr int TITLE_Y_PERCENT = 25;
|
||||
constexpr int PROMPT_Y_PERCENT = 60;
|
||||
constexpr int COPYRIGHT_Y_PERCENT = 90;
|
||||
constexpr int LOGO_GAP_PX = 2; // Separació vertical entre el minilogo i el text de copyright.
|
||||
|
||||
// Detecta una pulsació de START dins el frame actual per al jugador
|
||||
// indicat. Combina events de teclat (scancode hardcoded a Defaults::
|
||||
// KeysGame[P2]) i events de gamepad (botó remapejable via
|
||||
@@ -259,7 +254,7 @@ void TitleScene::render() {
|
||||
}
|
||||
|
||||
const Uint8 TEXT_COLOR = ui_config.titleTextColor();
|
||||
const Uint8 OUTLINE_COLOR = ui_config.titleCopyrightColor();
|
||||
const Uint8 OUTLINE_COLOR = ui_config.titlePressStartOutlineColor();
|
||||
constexpr Uint8 OUTLINE_DIST = 1;
|
||||
constexpr Uint8 STROKE4 = Text::CENTER_FLAG | Text::COLOR_FLAG | Text::STROKE4_FLAG;
|
||||
|
||||
@@ -268,7 +263,7 @@ void TitleScene::render() {
|
||||
// la primera línia del text. Substitueix els dos `display_font_`
|
||||
// que pintaven "Aventures en Egipte" + "A R C A D E".
|
||||
if (game_logo_) {
|
||||
const int LOGO_Y = (GameCanvas::HEIGHT * TITLE_Y_PERCENT) / 100;
|
||||
const int LOGO_Y = (GameCanvas::HEIGHT * ui_config.titleLogoYPercent()) / 100;
|
||||
const int LOGO_X = GameCanvas::CENTER_X - (game_logo_->getWidth() / 2);
|
||||
game_logo_->render(LOGO_X, LOGO_Y);
|
||||
}
|
||||
@@ -290,7 +285,7 @@ void TitleScene::render() {
|
||||
const bool VISIBLE = (cycle_ms == 0) || ((blink_elapsed_ms_ % cycle_ms) < visible_ms);
|
||||
|
||||
if (VISIBLE) {
|
||||
const int PROMPT_Y = (GameCanvas::HEIGHT * PROMPT_Y_PERCENT) / 100;
|
||||
const int PROMPT_Y = (GameCanvas::HEIGHT * ui_config.titlePromptYPercent()) / 100;
|
||||
condensed_font_->writeDX(STROKE4,
|
||||
GameCanvas::CENTER_X,
|
||||
PROMPT_Y,
|
||||
@@ -303,15 +298,16 @@ void TitleScene::render() {
|
||||
}
|
||||
|
||||
// Footer: minilogo centrat horitzontalment damunt del © de
|
||||
// copyright. El text va al 90% Y, el logo just damunt amb un petit
|
||||
// gap (LOGO_GAP_PX). El copyright fa servir una font pixel-art
|
||||
// pròpia (PixeloidSans-Bold) — més neta i petita que la del
|
||||
// "press start" perquè la jerarquia tipogràfica del peu quedi clara.
|
||||
// copyright. El text va al `title.copyright_y_percent`, el logo just
|
||||
// damunt amb un petit gap (`title.mini_logo_gap_px`). El copyright fa
|
||||
// servir una font pixel-art pròpia (Tiny5-Regular size 8) — més neta
|
||||
// i petita que la del "press start" perquè la jerarquia tipogràfica
|
||||
// del peu quedi clara.
|
||||
if (copyright_font_) {
|
||||
const int COPY_Y = (GameCanvas::HEIGHT * COPYRIGHT_Y_PERCENT) / 100;
|
||||
const int COPY_Y = (GameCanvas::HEIGHT * ui_config.titleCopyrightYPercent()) / 100;
|
||||
if (mini_logo_) {
|
||||
const int LOGO_X = GameCanvas::CENTER_X - (mini_logo_->getWidth() / 2);
|
||||
const int LOGO_Y = COPY_Y - mini_logo_->getHeight() - LOGO_GAP_PX;
|
||||
const int LOGO_Y = COPY_Y - mini_logo_->getHeight() - ui_config.titleMiniLogoGapPx();
|
||||
mini_logo_->render(LOGO_X, LOGO_Y);
|
||||
}
|
||||
copyright_font_->writeDX(Text::CENTER_FLAG | Text::COLOR_FLAG,
|
||||
|
||||
Reference in new issue
Block a user