|
|
|
@ -216,18 +216,16 @@ 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; |
|
|
|
|
|
|
|
|
|
void SFMLRender::draw_text(Panel &panel) { |
|
|
|
|
sf::RectangleShape backing( |
|
|
|
|
sf::Vector2f($ui_bounds.width * panel.width + border_px, |
|
|
|
|
$ui_bounds.height * panel.height + border_px)); |
|
|
|
|
sf::Vector2f($ui_bounds.width * panel.width + panel.border_px, |
|
|
|
|
$ui_bounds.height * panel.height + panel.border_px)); |
|
|
|
|
|
|
|
|
|
backing.setFillColor(sf::Color(0, 0, 0)); |
|
|
|
|
backing.setFillColor(panel.default_bg); |
|
|
|
|
|
|
|
|
|
if(with_border) { |
|
|
|
|
backing.setOutlineColor(color(Value::MID)); |
|
|
|
|
backing.setOutlineThickness(border_px); |
|
|
|
|
if(panel.has_border) { |
|
|
|
|
backing.setOutlineColor(panel.border_color); |
|
|
|
|
backing.setOutlineThickness(panel.border_px); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
backing.setPosition(panel.x, panel.y); |
|
|
|
|