#include using namespace sf; View view; void getplayercoordinateforview(float x, float y) { float tempX = x; float tempY = y; if (x < 320) tempX = 320; if (x > 880) tempX = 880; if (y < 240) tempY = 240; if (y > 510) tempY = 510; view.setCenter(tempX, tempY); } void changeview() { if (Keyboard::isKeyPressed(Keyboard::I)) { view.zoom(1.0040f); } if (Keyboard::isKeyPressed(Keyboard::P)) { view.zoom(10.0040f); } if (Keyboard::isKeyPressed(Keyboard::O)) { view.setSize(640, 480); } }