0 votes

I would like to present the content on a screen without any scaling (2d/viewport, hence I am choosing None) but with the content not pushed to the top left corner and only showing fixed part of the canvas (1920x1080).

Currently I am using an approach with a custom Camera2D where I just select AnchorMode = Drag Center. This almost works. The issue I am having is that if on the canvas (outside the camera) there are any elements (let's say part of the map) they will be presented.

My conclusion is simple: camera gets it size directly from the viewport. If the viewport changes (which is correlated with screen size it seems), the camera will too. This works, of course, for 2d/viewport where the camera doesn't change it's size.

I am aiming at changing the scale basing on the viewport size, so that I correct the size of camera. Is this the right approach to my problem?

Godot version 3.2.3
in Engine by (14 points)

Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.