You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a scene with a SubViewport in a SubViewportContainer. In the scene's _ready function I am attempting to set the SubViewport's size_2d_override property to a value smaller than the SubViewport/SubViewportContainer's size. e.g. The SubViewport's size is 512x512, while I'm setting it's size_2d_override to 100x100. This has no affect when the game runs; any children of the SubViewport are not scaled down properly.
This works fine if I set size_2d_override in the SubViewport's inspector. It also works fine if I resize it during the root's size_changed event.
Steps to reproduce
Create a new scene.
Add a SubViewportContainer to the scene root.
Add SubViewport to the SubViewportContainer.
Add a Sprite2D to the SubViewport.
In the SubViewport's inspector, set its size to 512x512 and set "Size 2D Override Stretch" to true. Do not set values for "Size 2D Override".
If someone who find this issue tries to do this (low res SubViewport in a high res game) in the editor, I listed the steps to follow here in the Reddit post.
Godot version
4.0.beta5.official (89a33d2)
System information
macOS 13.0.1
Issue description
I have a scene with a SubViewport in a SubViewportContainer. In the scene's _ready function I am attempting to set the SubViewport's size_2d_override property to a value smaller than the SubViewport/SubViewportContainer's size. e.g. The SubViewport's size is 512x512, while I'm setting it's size_2d_override to 100x100. This has no affect when the game runs; any children of the SubViewport are not scaled down properly.
This works fine if I set size_2d_override in the SubViewport's inspector. It also works fine if I resize it during the root's size_changed event.
Steps to reproduce
Expected Result: When the project is run, the sprite inside the SubViewport is scaled to reflect its size_2d_override.

Actual Result: No scaling is applied to the sprite.

Minimal reproduction project
ViewportTest.zip
The text was updated successfully, but these errors were encountered: