mirror of
https://github.com/zhenyan121/SporeBG-Conid.git
synced 2026-04-10 06:14:08 +08:00
feat: Add GameTitle
This commit is contained in:
@@ -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);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -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));
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user