Have an initial start screen and simple prototypes for other screens.

This commit is contained in:
Zed A. Shaw 2026-04-01 15:31:36 -04:00
parent e113c0bc97
commit d03020cfef
8 changed files with 139 additions and 53 deletions

29
src/gui/scene_ui.cpp Normal file
View file

@ -0,0 +1,29 @@
#include "gui/scene_ui.hpp"
#include "game/config.hpp"
namespace gui {
void SceneUI::init() {
$view_sprite.setPosition({0,0});
$scene.init();
}
void SceneUI::render(sf::RenderTarget &target) {
$scene.render($view_texture);
target.draw($view_sprite);
}
void SceneUI::update() {
$scene.update();
}
bool SceneUI::mouse(float x, float y, guecs::Modifiers mods) {
$scene.mouse(x, y, mods);
return false;
}
AnimatedScene SceneUI::load_scene(const std::string& name) {
auto scene_config = settings::get("scenes")[name];
return components::convert<AnimatedScene>(scene_config);
}
}