mirror of
https://github.com/zhenyan121/SporeBG-Conid.git
synced 2026-04-10 06:14:08 +08:00
Added a lots of the file to write the pixel game but due to some problem ,i dicide to change sdl3 to sfml,a more modern lib
This commit is contained in:
@@ -13,19 +13,26 @@ MainMenuUIManager::~MainMenuUIManager() {
|
||||
}
|
||||
|
||||
void MainMenuUIManager::init() {
|
||||
auto button = std::make_unique<Button>(m_textRenderer);
|
||||
auto button = std::make_unique<Button>();
|
||||
|
||||
button->setBackgroundColor({0, 150, 255, 255});
|
||||
|
||||
button->setBorder(2, {0, 0, 0, 255});
|
||||
button->setPosition(650, 430);
|
||||
|
||||
button->setRect(0, 0, UI::ButtonSize * 4, UI::ButtonSize * 2);
|
||||
|
||||
button->setName("StartButton");
|
||||
button->setText("Start Game", {"SourceHanSansSC-Regular.otf", 64, {255, 255, 255, 255}});
|
||||
|
||||
button->setText("Start Game", {"SourceHanSansSC-Regular.otf", UI::UI_NORMAL_FONT_SIZE, {255, 255, 255, 255}});
|
||||
|
||||
button->setCallback([this](){
|
||||
SDL_Log("Start Game button clicked!");
|
||||
m_eventCallback("GameScene");
|
||||
});
|
||||
|
||||
m_buttons.emplace(button->getNameHash(), std::move(button));
|
||||
auto label = std::make_unique<Label>();
|
||||
label->setPosition(1200, 20);
|
||||
label->setRect(1200, 20, 200, 50);
|
||||
label->setText("0 0", {"SourceHanSansSC-Regular.otf", 48, {0, 0, 0, 255}});
|
||||
label->setName("MousePositionLabel");
|
||||
m_labels.emplace(label->getNameHash(), std::move(label));
|
||||
|
||||
Reference in New Issue
Block a user