feat(ui): support scaling of labels and images

Modify width() and height() methods to multiply by m_scale for both Label and Image. Rename internal dimensions to m_real_width and m_real_height for clarity. Adjust Button foreground position to vertically center when label is scaled.
This commit is contained in:
2026-07-13 11:40:27 +08:00
parent b5e0bb9290
commit 1fa3b9cce8
5 changed files with 10 additions and 9 deletions

View File

@@ -18,6 +18,7 @@ void MainMenuUIManager::init() {
m_scene.scene_manager().app().texture_manager());
auto& fore = start_game_button->set_foreground<Label>();
fore.set_text("Start Game");
fore.set_scale(0.6f);
start_game_button->set_clicked(
[this]() { m_scene.scene_manager().request_push(SceneType::WORLD); });