SFML community forums
Help => Graphics => Topic started by: EClaesson on February 26, 2011, 01:14:33 pm
-
Hi. I want to show a 640x480 screen in a larger window. The window can be 800x600 or larger. I know that sf::View is good for this.
But how should i do it (for a 800x600 window)?
sf::View view;
view.setCenter(400, 300);
view.setHalfSize(400, 300);
view.Zoom(2.0f);
or
sf::View view;
view.setCenter(400, 300);
view.setHalfSize(320, 240);
or something else?
Thanks in advance.
-
The view shouldn't know anything about the window it will be displayed in. Just setup with the size that want to view (640x480). Same for the center, this is the center of the world area that you want to display, this has nothing to do with the size of the target window.
-
The view shouldn't know anything about the window it will be displayed in. Just setup with the size that want to view (640x480). Same for the center, this is the center of the world area that you want to display, this has nothing to do with the size of the target window.
Thanks a lot Laurent! I really appreciate that you're taking time to help us.
That's worth a Flattr ;)