Can do better rendering of individual components and 'panels' but it's not too clean right now.

main
Zed A. Shaw 3 weeks ago
parent 7b5c84b5f7
commit baaf56d4de
  1. 1
      gui.cpp
  2. 6
      render.cpp

@ -209,7 +209,6 @@ void GUI::render_scene() {
Render($status_screen, $status_ui->Render());
$renderer.draw_text_ui($status_screen, 0, 0);
$map_screen.Clear();
Render($map_screen, $map_view->Render());
$renderer.draw_screen($map_screen);

@ -42,7 +42,7 @@ SFMLRender::SFMLRender() :
$ui_text.setPosition(0,0);
$ui_text.setCharacterSize(UI_FONT_SIZE);
$ui_text.setFillColor(color(Value::LIGHT_MID));
sf::Glyph glyph = $font.getGlyph(L'H', UI_FONT_SIZE, false);
sf::Glyph glyph = $font.getGlyph(L'', UI_FONT_SIZE, false);
$ui_bounds = glyph.bounds;
}
@ -143,8 +143,8 @@ void SFMLRender::render_text(std::string &text, float x, float y) {
void SFMLRender::draw_text_ui(Screen &screen, float x, float y) {
sf::RectangleShape backing(
sf::Vector2f($ui_bounds.width * screen.dimx() * 1.4,
$ui_bounds.height * screen.dimy() * 1.6));
sf::Vector2f($ui_bounds.width * screen.dimx(),
$ui_bounds.height * screen.dimy()));
backing.setFillColor(sf::Color(0, 0, 0));
backing.setPosition(x, y);

Loading…
Cancel
Save