+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.

asked Apr 26 in Engine by Trollend (75 points)
edited Apr 26 by Trollend

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

+2 votes

https://www.youtube.com/watch?v=TQKXU7iSWUU&list=PL9FzW-m48fn2SlrW0KoLT4n5egNdX-W9a&index=3

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

answered Jun 8 by Robics (18 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 How to use this Q&A? before posting your first questions.