It's actually better to just use FTXUI's Modal system than to invent my own.

This commit is contained in:
Zed A. Shaw 2024-11-17 22:28:29 -05:00
parent 88d362d6a5
commit 958c8545a7
4 changed files with 16 additions and 15 deletions

View file

@ -217,15 +217,17 @@ void SFMLRender::render_text(const std::wstring &text, float start_x, float star
}
void SFMLRender::draw_text(Panel &panel, bool with_border) {
int border_px = with_border ? UI_PANEL_BORDER_PX : 0;
sf::RectangleShape backing(
sf::Vector2f($ui_bounds.width * panel.width,
$ui_bounds.height * panel.height));
sf::Vector2f($ui_bounds.width * panel.width + border_px,
$ui_bounds.height * panel.height + border_px));
backing.setFillColor(sf::Color(0, 0, 0));
if(with_border) {
backing.setOutlineColor(color(Value::MID));
backing.setOutlineThickness(5);
backing.setOutlineColor($default_fg);
backing.setOutlineThickness(border_px);
}
backing.setPosition(panel.x, panel.y);