1
Graphics / q: how to use the sf:view correctly?
« on: June 01, 2015, 04:46:40 pm »
I defined the size of the window as (800,650) and i have image of (1439,659).
I want to see just part of the image so that i can move a little to the sides and still be on the image.
What that happen is that instead of showing just the part of the image it's squeezing almost the whole image into the screen.
code:
when middle_x and middle_y is the center of the image.
I want to see just part of the image so that i can move a little to the sides and still be on the image.
What that happen is that instead of showing just the part of the image it's squeezing almost the whole image into the screen.
code:
sf::View view(sf::Vector2f(middle_x, middle_y), sf::Vector2f(window.getSize().x, window.getSize().y));
view.setSize(WINDOW_X_LENGTH, WINDOW_Y_LENGTH - 50);
view.setSize(WINDOW_X_LENGTH, WINDOW_Y_LENGTH - 50);
when middle_x and middle_y is the center of the image.