feat: Add GameTitle

This commit is contained in:
2026-02-04 16:38:21 +08:00
parent 940f0b11a1
commit ede8dfbb26
3 changed files with 11 additions and 3 deletions

View File

@@ -30,10 +30,10 @@ void MainMenuScene::update() {
void MainMenuScene::renderWorld() {
SDL_FRect test = {20, 20, 20, 20};
//SDL_FRect test = {20, 20, 20, 20};
// 渲染场景内容
SDL_SetRenderDrawColor(m_renderer, 20, 20,20, 255);
SDL_RenderFillRect(m_renderer, &test);
//SDL_SetRenderDrawColor(m_renderer, 20, 20,20, 255);
//SDL_RenderFillRect(m_renderer, &test);
}

View File

@@ -25,6 +25,13 @@ void MainMenuUIManager::init() {
);
m_buttons.emplace(onlineStartButton->getNameHash(), std::move(onlineStartButton));
auto titelLabel = UIWidgetFactory::createStandardLabel(
"TitleLabel", "SporeBG-Conid", 275, 20
);
titelLabel->setRect(225, 20, UI::TitleSize, UI::TitleSize);
titelLabel->setText("SporeBG-Conid", {"SourceHanSansSC-Regular.otf", UI::UI_NORMAL_FONT_SIZE * 2, {173, 216, 189, 255}});
m_labels.emplace(titelLabel->getNameHash(), std::move(titelLabel));
}

View File

@@ -49,6 +49,7 @@ namespace UI
constexpr int LogicalWidth = 640;
constexpr int LogicalHeight = 360;
constexpr int TitleSize = 16 * 8;
// 字体大小(逻辑像素)
constexpr int DIALOG_FONT_SIZE = 14;
constexpr int UI_SMALL_FONT_SIZE = 8;