You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
53 lines
1.1 KiB
53 lines
1.1 KiB
#include "overlay_ui.hpp"
|
|
#include "constants.hpp"
|
|
#include "color.hpp"
|
|
#include "events.hpp"
|
|
#include <optional>
|
|
|
|
namespace gui {
|
|
using namespace guecs;
|
|
using std::string;
|
|
|
|
OverlayUI::OverlayUI() {
|
|
$gui.position(RAY_VIEW_X, RAY_VIEW_Y, RAY_VIEW_WIDTH, RAY_VIEW_HEIGHT);
|
|
$gui.layout(
|
|
"[top_left|top|top_right]"
|
|
"[*%(300,300)middle|_|_]"
|
|
"[_|_|_]"
|
|
"[_|_|_]"
|
|
"[bottom_left|bottom|bottom_right]"
|
|
);
|
|
}
|
|
|
|
void OverlayUI::init() {
|
|
$gui.init();
|
|
}
|
|
|
|
void OverlayUI::render(sf::RenderWindow& window) {
|
|
$gui.render(window);
|
|
}
|
|
|
|
void OverlayUI::show_sprite(string region, string sprite_name) {
|
|
$gui.show_sprite(region, sprite_name);
|
|
}
|
|
|
|
void OverlayUI::close_sprite(string region) {
|
|
$gui.close<Sprite>(region);
|
|
}
|
|
|
|
void OverlayUI::show_text(string region, string content) {
|
|
$gui.show_text(region, content);
|
|
}
|
|
|
|
void OverlayUI::close_text(string region) {
|
|
$gui.close<Textual>(region);
|
|
}
|
|
|
|
void OverlayUI::show_label(string region, string content) {
|
|
$gui.show_label(region, content);
|
|
}
|
|
|
|
void OverlayUI::close_label(string region) {
|
|
$gui.close<Label>(region);
|
|
}
|
|
}
|
|
|