On the internet, I saw videos and tutorials about screen scrolling. But those only show how to keep the player always in the center of the camera.
I want my camera to scroll over the level, following the character, only when the character is within the 20% border of the screen.
So, when the player is not close to the edge of the window then the camera stays in place and not follow the player and when the player crosses this "scrolling line" the camera should smoothly follow hit. Let's say that my game window is 1000px wide and 500px high, but the game map is 3000px wide and 3000px high.
SpriteBatch.GraphicsDevice.Viewport.Width
andGraphicsDeviceManager.PreferredBackBufferWidtht
? \$\endgroup\$