It's actually better to just use FTXUI's Modal system than to invent my own.
This commit is contained in:
parent
88d362d6a5
commit
958c8545a7
4 changed files with 16 additions and 15 deletions
10
render.cpp
10
render.cpp
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue