Hi, so, I'm new to SFML and I am trying to make a shmup, which requires i basically have a game running in one viewport with UI elements around it, sort of like this
https://tess.s-ul.eu/Dav4Za2hbut instead, i get this
https://tess.s-ul.eu/PLS87rnfi don't know why the textures get scaled when i resize the view. i am resizing it as follows:
World::World(sf::RenderWindow& window)
: _window(window)
, _game_view(window.getDefaultView())
, _bg_view(window.getDefaultView())
, _game_bounds(0.f, 0.f, _game_view.getSize().x, _game_view.getSize().y) // x, y, width, height
, _spawn_position(_game_view.getSize().x / 2.f, _game_bounds.height - _game_view.getSize().y / 2.f)
, _scroll_speed(-50.f)
, _maiden(nullptr)
{
load_tex();
build_scene();
_game_view.setCenter(_spawn_position);
_game_view.setViewport(sf::FloatRect(0.35f, 0.02f, 0.35f, 0.96f));
_window.setView(_game_view);
}
how do i set it so that only a certain area is shown without resizing the textures? thanks a bunch!