Simple Loot UI started.

This commit is contained in:
Zed A. Shaw 2025-05-14 00:51:53 -04:00
parent 8a3046e141
commit 8545b8cf1d
23 changed files with 139 additions and 29 deletions

51
gui/overlay_ui.cpp Normal file
View file

@ -0,0 +1,51 @@
#include "gui/overlay_ui.hpp"
#include "constants.hpp"
#include "color.hpp"
#include "events.hpp"
#include <optional>
namespace gui {
using namespace guecs;
OverlayUI::OverlayUI() {
$gui.position(RAY_VIEW_X, RAY_VIEW_Y, RAY_VIEW_WIDTH, RAY_VIEW_HEIGHT);
$gui.layout(
"[*%(100,300)left|top|>(170,170)top_right]"
"[_|middle|middle_right]"
"[_|bottom|bottom_right]"
);
}
void OverlayUI::init() {
$gui.init();
}
void OverlayUI::render(sf::RenderWindow& window) {
$gui.render(window);
// $gui.debug_layout(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, wstring content) {
$gui.show_text(region, content);
}
void OverlayUI::close_text(string region) {
$gui.close<Textual>(region);
}
void OverlayUI::show_label(string region, wstring content) {
$gui.show_label(region, content);
}
void OverlayUI::close_label(string region) {
$gui.close<Label>(region);
}
}