feat(title): peu amb minilogo i copyright; fonts ari regenerades amb ©
This commit is contained in:
1 parent
dadbee9bad
commit
158968e2c2
14 files changed
+55
-14
No files matched your search
@@ -13,6 +13,7 @@
|
||||
#include "core/rendering/notifier.hpp"
|
||||
#include "core/rendering/render_info.hpp"
|
||||
#include "core/rendering/screen.hpp"
|
||||
#include "core/rendering/surface.hpp"
|
||||
#include "core/rendering/text.hpp"
|
||||
#include "core/resources/resource_cache.hpp"
|
||||
#include "core/system/event_buffer.hpp"
|
||||
@@ -34,6 +35,8 @@ namespace {
|
||||
|
||||
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.
|
||||
|
||||
// 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
|
||||
@@ -45,9 +48,10 @@ 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)),
|
||||
condensed_font_(std::move(condensed_font)),
|
||||
mini_logo_(std::move(mini_logo)),
|
||||
next_factory_(std::move(next_factory)),
|
||||
timer_ms_(UiConfig::get().titleDurationMs()) {
|
||||
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();
|
||||
RenderInfo::get().render();
|
||||
Screen::get().present();
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
|
||||
#include "core/scene/scene.hpp"
|
||||
|
||||
class Surface;
|
||||
class Text;
|
||||
|
||||
// Escena TITLE provisional. Pinta dos blocs de text sobre un fons gairebé
|
||||
@@ -15,7 +16,7 @@ class TitleScene : public Scene {
|
||||
public:
|
||||
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;
|
||||
|
||||
void update(int delta_ms) override;
|
||||
@@ -24,6 +25,7 @@ class TitleScene : public Scene {
|
||||
private:
|
||||
std::shared_ptr<Text> display_font_;
|
||||
std::shared_ptr<Text> condensed_font_;
|
||||
std::shared_ptr<Surface> mini_logo_;
|
||||
SceneFactory next_factory_;
|
||||
int timer_ms_;
|
||||
int blink_elapsed_ms_{0};
|
||||
|
||||
Reference in new issue
Block a user