feat(title): peu amb minilogo i copyright; fonts ari regenerades amb ©
No files matched your search
@@ -1,5 +1,5 @@
|
|||||||
# Font: ari-w9500-condensed-display — generado desde ari-w9500-condensed-display.ttf size 11
|
# Font: ari-w9500-condensed-display — generado desde ari-w9500-condensed-display.ttf size 11
|
||||||
# Generado con tools/font_gen/font_gen.py
|
# Generado con font_gen.py
|
||||||
|
|
||||||
box_width 12
|
box_width 12
|
||||||
box_height 11
|
box_height 11
|
||||||
@@ -105,8 +105,8 @@ columns 15
|
|||||||
193 8 # Á
|
193 8 # Á
|
||||||
200 7 # È
|
200 7 # È
|
||||||
201 7 # É
|
201 7 # É
|
||||||
204 3 # Ì
|
204 4 # Ì
|
||||||
205 3 # Í
|
205 4 # Í
|
||||||
210 9 # Ò
|
210 9 # Ò
|
||||||
211 9 # Ó
|
211 9 # Ó
|
||||||
217 7 # Ù
|
217 7 # Ù
|
||||||
@@ -118,7 +118,7 @@ columns 15
|
|||||||
232 7 # è
|
232 7 # è
|
||||||
233 7 # é
|
233 7 # é
|
||||||
236 4 # ì
|
236 4 # ì
|
||||||
237 3 # í
|
237 4 # í
|
||||||
242 7 # ò
|
242 7 # ò
|
||||||
243 7 # ó
|
243 7 # ó
|
||||||
249 7 # ù
|
249 7 # ù
|
||||||
@@ -126,7 +126,8 @@ columns 15
|
|||||||
241 7 # ñ
|
241 7 # ñ
|
||||||
231 7 # ç
|
231 7 # ç
|
||||||
161 3 # ¡
|
161 3 # ¡
|
||||||
191 7 # ¿
|
191 5 # ¿
|
||||||
171 10 # «
|
171 10 # «
|
||||||
187 10 # »
|
187 10 # »
|
||||||
183 3 # ·
|
183 3 # ·
|
||||||
|
169 10 # ©
|
||||||
|
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.2 KiB |
@@ -1,5 +1,5 @@
|
|||||||
# Font: ari-w9500-display — generado desde ari-w9500-display.ttf size 11
|
# Font: ari-w9500-display — generado desde ari-w9500-display.ttf size 11
|
||||||
# Generado con tools/font_gen/font_gen.py
|
# Generado con font_gen.py
|
||||||
|
|
||||||
box_width 12
|
box_width 12
|
||||||
box_height 11
|
box_height 11
|
||||||
@@ -105,8 +105,8 @@ columns 15
|
|||||||
193 9 # Á
|
193 9 # Á
|
||||||
200 8 # È
|
200 8 # È
|
||||||
201 8 # É
|
201 8 # É
|
||||||
204 3 # Ì
|
204 4 # Ì
|
||||||
205 3 # Í
|
205 4 # Í
|
||||||
210 10 # Ò
|
210 10 # Ò
|
||||||
211 10 # Ó
|
211 10 # Ó
|
||||||
217 8 # Ù
|
217 8 # Ù
|
||||||
@@ -118,7 +118,7 @@ columns 15
|
|||||||
232 8 # è
|
232 8 # è
|
||||||
233 8 # é
|
233 8 # é
|
||||||
236 4 # ì
|
236 4 # ì
|
||||||
237 3 # í
|
237 4 # í
|
||||||
242 8 # ò
|
242 8 # ò
|
||||||
243 8 # ó
|
243 8 # ó
|
||||||
249 8 # ù
|
249 8 # ù
|
||||||
@@ -126,7 +126,8 @@ columns 15
|
|||||||
241 8 # ñ
|
241 8 # ñ
|
||||||
231 8 # ç
|
231 8 # ç
|
||||||
161 3 # ¡
|
161 3 # ¡
|
||||||
191 8 # ¿
|
191 5 # ¿
|
||||||
171 10 # «
|
171 10 # «
|
||||||
187 10 # »
|
187 10 # »
|
||||||
183 3 # ·
|
183 3 # ·
|
||||||
|
169 10 # ©
|
||||||
|
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.2 KiB |
|
After Width: | Height: | Size: 494 B |
|
After Width: | Height: | Size: 200 B |
|
After Width: | Height: | Size: 99 B |
@@ -110,5 +110,6 @@ title:
|
|||||||
duration_ms: 30000
|
duration_ms: 30000
|
||||||
bg_color: 1
|
bg_color: 1
|
||||||
text_color: 31
|
text_color: 31
|
||||||
|
copyright_color: 246
|
||||||
blink_visible_ms: 800
|
blink_visible_ms: 800
|
||||||
blink_hidden_ms: 200
|
blink_hidden_ms: 200
|
||||||
@@ -203,6 +203,14 @@ Director::Director() {
|
|||||||
};
|
};
|
||||||
auto menu_title_text = load_menu_font(UiConfig::get().menuTitleFont());
|
auto menu_title_text = load_menu_font(UiConfig::get().menuTitleFont());
|
||||||
auto menu_items_text = load_menu_font(UiConfig::get().menuItemsFont());
|
auto menu_items_text = load_menu_font(UiConfig::get().menuItemsFont());
|
||||||
|
|
||||||
|
// Mini-logo del peu de la TITLE. Es preloda ací per consistència
|
||||||
|
// amb la resta d'assets d'UI; manté la seua paleta original (no la
|
||||||
|
// sobreescrivim amb la "ui" perquè el GIF ja porta els colors finals
|
||||||
|
// del logo).
|
||||||
|
constexpr const char* MINI_LOGO_KEY = "logo_jailgames_mini.gif";
|
||||||
|
Resource::Cache::get().loadSurface(MINI_LOGO_KEY, "data/logo/logo_jailgames_mini.gif");
|
||||||
|
auto mini_logo_surface = Resource::Cache::get().getSurface(MINI_LOGO_KEY);
|
||||||
ServiceMenu::get().init(menu_title_text, menu_items_text, ui_palette);
|
ServiceMenu::get().init(menu_title_text, menu_items_text, ui_palette);
|
||||||
|
|
||||||
// Overlay hook: Screen::present() cridarà aquesta lambda al principi,
|
// Overlay hook: Screen::present() cridarà aquesta lambda al principi,
|
||||||
@@ -251,8 +259,8 @@ Director::Director() {
|
|||||||
auto make_intro = [placeholder_text, make_game]() -> std::unique_ptr<Scene> {
|
auto make_intro = [placeholder_text, make_game]() -> std::unique_ptr<Scene> {
|
||||||
return std::make_unique<IntroScene>(placeholder_text, make_game);
|
return std::make_unique<IntroScene>(placeholder_text, make_game);
|
||||||
};
|
};
|
||||||
auto make_title = [menu_title_text, placeholder_text, make_intro]() -> std::unique_ptr<Scene> {
|
auto make_title = [menu_title_text, placeholder_text, mini_logo_surface, make_intro]() -> std::unique_ptr<Scene> {
|
||||||
return std::make_unique<TitleScene>(menu_title_text, placeholder_text, make_intro);
|
return std::make_unique<TitleScene>(menu_title_text, placeholder_text, mini_logo_surface, make_intro);
|
||||||
};
|
};
|
||||||
|
|
||||||
switch (START) {
|
switch (START) {
|
||||||
|
|||||||
@@ -99,6 +99,7 @@ UiConfig::UiConfig()
|
|||||||
title_duration_ms_(Defaults::UI::Title::DURATION_MS),
|
title_duration_ms_(Defaults::UI::Title::DURATION_MS),
|
||||||
title_bg_color_(Defaults::UI::Title::BG_COLOR),
|
title_bg_color_(Defaults::UI::Title::BG_COLOR),
|
||||||
title_text_color_(Defaults::UI::Title::TEXT_COLOR),
|
title_text_color_(Defaults::UI::Title::TEXT_COLOR),
|
||||||
|
title_copyright_color_(Defaults::UI::Title::COPYRIGHT_COLOR),
|
||||||
title_blink_visible_ms_(Defaults::UI::Title::BLINK_VISIBLE_MS),
|
title_blink_visible_ms_(Defaults::UI::Title::BLINK_VISIBLE_MS),
|
||||||
title_blink_hidden_ms_(Defaults::UI::Title::BLINK_HIDDEN_MS),
|
title_blink_hidden_ms_(Defaults::UI::Title::BLINK_HIDDEN_MS),
|
||||||
menu_select_sound_(Defaults::UI::MENU_SELECT_SOUND),
|
menu_select_sound_(Defaults::UI::MENU_SELECT_SOUND),
|
||||||
@@ -214,6 +215,7 @@ void UiConfig::load(const std::string& file_path) {
|
|||||||
readField(t, "duration_ms", title_duration_ms_);
|
readField(t, "duration_ms", title_duration_ms_);
|
||||||
readColorIndex(t, "bg_color", title_bg_color_);
|
readColorIndex(t, "bg_color", title_bg_color_);
|
||||||
readColorIndex(t, "text_color", title_text_color_);
|
readColorIndex(t, "text_color", title_text_color_);
|
||||||
|
readColorIndex(t, "copyright_color", title_copyright_color_);
|
||||||
readField(t, "blink_visible_ms", title_blink_visible_ms_);
|
readField(t, "blink_visible_ms", title_blink_visible_ms_);
|
||||||
readField(t, "blink_hidden_ms", title_blink_hidden_ms_);
|
readField(t, "blink_hidden_ms", title_blink_hidden_ms_);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -85,6 +85,7 @@ class UiConfig {
|
|||||||
[[nodiscard]] auto titleDurationMs() const -> int { return title_duration_ms_; }
|
[[nodiscard]] auto titleDurationMs() const -> int { return title_duration_ms_; }
|
||||||
[[nodiscard]] auto titleBgColor() const -> Uint8 { return title_bg_color_; }
|
[[nodiscard]] auto titleBgColor() const -> Uint8 { return title_bg_color_; }
|
||||||
[[nodiscard]] auto titleTextColor() const -> Uint8 { return title_text_color_; }
|
[[nodiscard]] auto titleTextColor() const -> Uint8 { return title_text_color_; }
|
||||||
|
[[nodiscard]] auto titleCopyrightColor() const -> Uint8 { return title_copyright_color_; }
|
||||||
[[nodiscard]] auto titleBlinkVisibleMs() const -> int { return title_blink_visible_ms_; }
|
[[nodiscard]] auto titleBlinkVisibleMs() const -> int { return title_blink_visible_ms_; }
|
||||||
[[nodiscard]] auto titleBlinkHiddenMs() const -> int { return title_blink_hidden_ms_; }
|
[[nodiscard]] auto titleBlinkHiddenMs() const -> int { return title_blink_hidden_ms_; }
|
||||||
|
|
||||||
@@ -155,6 +156,7 @@ class UiConfig {
|
|||||||
int title_duration_ms_;
|
int title_duration_ms_;
|
||||||
Uint8 title_bg_color_;
|
Uint8 title_bg_color_;
|
||||||
Uint8 title_text_color_;
|
Uint8 title_text_color_;
|
||||||
|
Uint8 title_copyright_color_;
|
||||||
int title_blink_visible_ms_;
|
int title_blink_visible_ms_;
|
||||||
int title_blink_hidden_ms_;
|
int title_blink_hidden_ms_;
|
||||||
|
|
||||||
|
|||||||
@@ -13,6 +13,7 @@
|
|||||||
#include "core/rendering/notifier.hpp"
|
#include "core/rendering/notifier.hpp"
|
||||||
#include "core/rendering/render_info.hpp"
|
#include "core/rendering/render_info.hpp"
|
||||||
#include "core/rendering/screen.hpp"
|
#include "core/rendering/screen.hpp"
|
||||||
|
#include "core/rendering/surface.hpp"
|
||||||
#include "core/rendering/text.hpp"
|
#include "core/rendering/text.hpp"
|
||||||
#include "core/resources/resource_cache.hpp"
|
#include "core/resources/resource_cache.hpp"
|
||||||
#include "core/system/event_buffer.hpp"
|
#include "core/system/event_buffer.hpp"
|
||||||
@@ -34,6 +35,8 @@ namespace {
|
|||||||
|
|
||||||
constexpr int TITLE_Y_PERCENT = 25;
|
constexpr int TITLE_Y_PERCENT = 25;
|
||||||
constexpr int PROMPT_Y_PERCENT = 60;
|
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.
|
||||||
|
|
||||||
// Separació vertical entre la primera i segona línia del títol. Una
|
// Separació vertical entre la primera i segona línia del títol. Una
|
||||||
// alçada de línia és l'opció més llegible al canvas de 240 px sense
|
// alçada de línia és l'opció més llegible al canvas de 240 px sense
|
||||||
@@ -45,9 +48,10 @@ namespace {
|
|||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
TitleScene::TitleScene(std::shared_ptr<Text> display_font, std::shared_ptr<Text> condensed_font, SceneFactory next_factory)
|
TitleScene::TitleScene(std::shared_ptr<Text> display_font, std::shared_ptr<Text> condensed_font, std::shared_ptr<Surface> mini_logo, SceneFactory next_factory)
|
||||||
: display_font_(std::move(display_font)),
|
: display_font_(std::move(display_font)),
|
||||||
condensed_font_(std::move(condensed_font)),
|
condensed_font_(std::move(condensed_font)),
|
||||||
|
mini_logo_(std::move(mini_logo)),
|
||||||
next_factory_(std::move(next_factory)),
|
next_factory_(std::move(next_factory)),
|
||||||
timer_ms_(UiConfig::get().titleDurationMs()) {
|
timer_ms_(UiConfig::get().titleDurationMs()) {
|
||||||
std::cout << "[scene] " << SCENE_NAME << " start\n";
|
std::cout << "[scene] " << SCENE_NAME << " start\n";
|
||||||
@@ -120,6 +124,25 @@ 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). Tots dos blocs són hardcodejats fins que
|
||||||
|
// tinguem artwork final.
|
||||||
|
if (condensed_font_) {
|
||||||
|
const int COPY_Y = (GameCanvas::HEIGHT * COPYRIGHT_Y_PERCENT) / 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;
|
||||||
|
mini_logo_->render(LOGO_X, LOGO_Y);
|
||||||
|
}
|
||||||
|
condensed_font_->writeDX(Text::CENTER_FLAG | Text::COLOR_FLAG,
|
||||||
|
GameCanvas::CENTER_X,
|
||||||
|
COPY_Y,
|
||||||
|
"© 2026 JailDesigner",
|
||||||
|
condensed_font_->getDefaultKerning() - 1,
|
||||||
|
ui_config.titleCopyrightColor());
|
||||||
|
}
|
||||||
|
|
||||||
Notifier::get().render();
|
Notifier::get().render();
|
||||||
RenderInfo::get().render();
|
RenderInfo::get().render();
|
||||||
Screen::get().present();
|
Screen::get().present();
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
#include "core/scene/scene.hpp"
|
#include "core/scene/scene.hpp"
|
||||||
|
|
||||||
|
class Surface;
|
||||||
class Text;
|
class Text;
|
||||||
|
|
||||||
// Escena TITLE provisional. Pinta dos blocs de text sobre un fons gairebé
|
// Escena TITLE provisional. Pinta dos blocs de text sobre un fons gairebé
|
||||||
@@ -15,7 +16,7 @@ class TitleScene : public Scene {
|
|||||||
public:
|
public:
|
||||||
using SceneFactory = std::function<std::unique_ptr<Scene>()>;
|
using SceneFactory = std::function<std::unique_ptr<Scene>()>;
|
||||||
|
|
||||||
TitleScene(std::shared_ptr<Text> display_font, std::shared_ptr<Text> condensed_font, SceneFactory next_factory);
|
TitleScene(std::shared_ptr<Text> display_font, std::shared_ptr<Text> condensed_font, std::shared_ptr<Surface> mini_logo, SceneFactory next_factory);
|
||||||
~TitleScene() override;
|
~TitleScene() override;
|
||||||
|
|
||||||
void update(int delta_ms) override;
|
void update(int delta_ms) override;
|
||||||
@@ -24,6 +25,7 @@ class TitleScene : public Scene {
|
|||||||
private:
|
private:
|
||||||
std::shared_ptr<Text> display_font_;
|
std::shared_ptr<Text> display_font_;
|
||||||
std::shared_ptr<Text> condensed_font_;
|
std::shared_ptr<Text> condensed_font_;
|
||||||
|
std::shared_ptr<Surface> mini_logo_;
|
||||||
SceneFactory next_factory_;
|
SceneFactory next_factory_;
|
||||||
int timer_ms_;
|
int timer_ms_;
|
||||||
int blink_elapsed_ms_{0};
|
int blink_elapsed_ms_{0};
|
||||||
|
|||||||
@@ -255,6 +255,7 @@ namespace Defaults {
|
|||||||
constexpr int DURATION_MS = 30000;
|
constexpr int DURATION_MS = 30000;
|
||||||
constexpr Uint8 BG_COLOR = 1;
|
constexpr Uint8 BG_COLOR = 1;
|
||||||
constexpr Uint8 TEXT_COLOR = 31;
|
constexpr Uint8 TEXT_COLOR = 31;
|
||||||
|
constexpr Uint8 COPYRIGHT_COLOR = 246; // (218,218,255) off-white amb un mínim de fred.
|
||||||
constexpr int BLINK_VISIBLE_MS = 800;
|
constexpr int BLINK_VISIBLE_MS = 800;
|
||||||
constexpr int BLINK_HIDDEN_MS = 200;
|
constexpr int BLINK_HIDDEN_MS = 200;
|
||||||
} // namespace Title
|
} // namespace Title
|
||||||
|
|||||||