Have an initial start screen and simple prototypes for other screens.
This commit is contained in:
parent
e113c0bc97
commit
d03020cfef
8 changed files with 139 additions and 53 deletions
29
src/gui/scene_ui.cpp
Normal file
29
src/gui/scene_ui.cpp
Normal 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);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue