This is the testing Godot forums! All forum posts unique to this forum will be deleted! Please use the main forums here for any posts you want to keep. All forum rules still apply.

How to change the camera view

DarlesLSFDarlesLSF Posts: 6Member

Hello all, I'm new on Godot and I want to change the view of the camera. Example: the window size is 640x480, but I want set the view of the camera to 320x240.
How can I do that?

Best Answer

  • TwistedTwiglegTwistedTwigleg Posts: 2,561
    Accepted Answer

    Have you tried the zoom property in the Camera2D node? (Documentation)

    The zoom property allows you to display the game view zoomed in or out depending on the value inserted. A value of (0.5, 0.5) should give you a 320x240 view when the game window is 640x480.


    If your project size is set to 320x240 and this is occurring when you resize the game window, you will need to change the stretch property in the project settings to either 2d or Viewport. The documentation explains what each of the modes do.

Answers

  • MegalomaniakMegalomaniak Posts: 2,580Admin

    There's multiple ways this could be interpreted, could you explain a bit better?

  • DarlesLSFDarlesLSF Posts: 6Member

    Like this:

    The window's size 640x480, but the view inside is 320x240.![]

  • TwistedTwiglegTwistedTwigleg Posts: 2,561Admin
    Accepted Answer

    Have you tried the zoom property in the Camera2D node? (Documentation)

    The zoom property allows you to display the game view zoomed in or out depending on the value inserted. A value of (0.5, 0.5) should give you a 320x240 view when the game window is 640x480.


    If your project size is set to 320x240 and this is occurring when you resize the game window, you will need to change the stretch property in the project settings to either 2d or Viewport. The documentation explains what each of the modes do.

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.