mirror of
https://github.com/zhenyan121/Cubed.git
synced 2026-08-08 17:57:02 +08:00
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:
@@ -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); });
|
||||
|
||||
Reference in New Issue
Block a user