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: 1,677
    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: 1,627Admin

    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: 1,677Admin
    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

BoldItalicStrikethroughOrdered listUnordered list
Emoji
Image
Align leftAlign centerAlign rightToggle HTML viewToggle full pageToggle lights
Drop image/file