The Godot Q&A is currently undergoing maintenance!

Your ability to ask and answer questions is temporarily disabled. You can browse existing threads in read-only mode.

We are working on bringing this community platform back to its full functionality, stay tuned for updates. | Twitter

+2 votes

The problem:

With the settings of:
- Stretch Mode: 2D
- Aspect: Keep

My project displays an area outside the viewport to either side.

Changing the settings to:
- Stretch Mode: 2D
- Aspect: Ignore

solves this issue. However, I get the following warning every time the screen resizes:

updaterootrect: Font oversampling only works with the resize modes 'Keep Width', 'Keep Height', and 'Expand'.
<C++ Source> scene/main/scene
tree.cpp:1153 @ updateroot_rect()

I have tried disabling this warning under Project -> Project Settings -> Debug -> GDScript, but even disabling all warnings does not prevent it from showing up in the debugger. What does remove the warning is disabling Font Oversampling in Project -> Project Settings -> Rendering -> Quality -> Font Oversampling. However, the text of the project then looks low quality and does not scale well with larger screens.

The warning seems to suggest oversampling does not work with the viewport settings I have chosen, however it seems to work just fine. The project is as I would like it now - I would just like to remove the warning I am seeing, or have a way to show only what is in the viewport in the editor when the game is launched with Font Oversampling activated.

in Engine by (88 points)
edited by

I don't entirely know why it's giving you that warning even when you disabled all the warnings. The reason could be due to your Viewport using a stretch mode (as detailed in this issue).

I saw that post too, but unfortunately if I change the stretch mode to to disabled, the project won't work resize with the window, meaning it either crops the scene if the window is bigger than the default resolution or it shows large blanks if it is larger than the default resolution. Using the "viewport" setting for stretch mode still generates the warning.

1 Answer

+1 vote

In this tutorial HeartBeast describes a solution.
project->project settings->window->strech->aspect: set it to keep

by (16 points)

Yeah, I tried this as I said in my post and having the viewport kept as "keep" shows solid black lines on either end of the program - Godot's background, an area outside the viewport.

Try using the Expand stretch aspect instead of Keep. You can then add any kind of custom background easily (or zoom in dynamically depending on the aspect ratio).

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 Frequently asked questions and 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 [email protected] with your username.