Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Dilloid

Pages: [1]
1
I would certainly love to show you the whole engine but it is split into like 5 different libraries so it would be ridiculous to attempt to show it all. Thank you guys for your help, I will try some of this stuff when I can and get back to you.

2
Do you setCenter for the View?

I wasn't before, but here's the result after doing that:
(click to show/hide)

3
The game runs entirely in that function, yes. As far as I can tell (I didn't write all of the code, we were provided with custom libraries), the window/view never changes aside from there and the settings scene where you can change it, in which case I make sure to preserve the view:
View view = Engine::getWindow().getView();
Vector2u resolution = resolutionToVector(ents.find("resolution"
    + to_string(resolutionCounter))[0]->getComponents<TextComponent>()[0]->getText().getString());
Engine::getWindow().create(VideoMode({ resolution.x, resolution.y }),
    Engine::gameName, (currentWindowMode == 0) ? Style::Fullscreen : Style::Default);
Engine::getWindow().setView(view);
 

It may be worth noting that the level is offset by exactly the difference between 720 and 1080, and that I can manually add an offset to put it back in the right place. However, the debug text in the top left then moves down with it. It's confusing because some text is in the correct place and some text isn't, so I can't exactly isolate it to one element that's positioned wrongly.

4
This is how my game is supposed to look (so far):
(click to show/hide)

That's when creating a view of size 1920x1080 and displaying it in a fullscreen 1080p window.

When I change the resolution to 720p and re-set the view to a FloatRect(0, 0, 1920, 1080), it looks like this:
(click to show/hide)

This is the code that sets up the window and view:
const std::string& gameName, Scene* scn) {
RenderWindow rw(VideoMode(Vector2u(1280.f, 720.f)), gameName, sf::Style::Fullscreen);
Engine::gameName = gameName;
window = &rw;

View view(FloatRect(Vector2f(0.f, 0.f), Vector2f(1920.f, 1080.f)));
rw.setView(view);
 

I have looked at the code that places the tiles over and over and theres no reason it should be displaying like this. And then the debug text still lines up but the pause menu text doesn't. I am so confused and this is for an assignment that's due in a few days so I don't have time to start over. Is this a common problem with a known solution? I did try googling and found nothing.

Please let me know what you think. I am brand new to SFML and don't want to lose marks over this <3

Edit: Updated to fix images

Pages: [1]