Make camera always show the same area

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Vercte


I’m looking for a way to always show the same amount of screen, even if you resize the window, or play the game on a larger monitor. I’m using a Camera2d for this.

For an example, I have a drawing:

The red part is the resized window/larger screen, and the blue is the desired area to show.
The black squares are objects for reference, to show how this an affect gameplay; think of them as items, enemies, other players, etc.

How can I program the Camera to only show the blue area, regardless of window size?

:bust_in_silhouette: Reply From: horsecar123

In your Project Settings go to Display/Window and in Stretch /Aspect try keep height and other mods.