How to add responsive background images?

Godot Version

Godot v.4.3

Question

Hello, I try to add an responsive background image to my scene. I want it to always cover the entire background (so no background color is visible). I sadly only know how to achieve this in web development (background-size: cover). But here is what I mean:

How can I achieve this? I only got my TextureRect with its image inside.

Use Stretch mode “Keep Aspect Covered”

2025-01-13-101006_345x355_scrot

This works well in my control scene, but not in my 2d scene. Do you know why?

2D nodes as parents of control nodes create a strange non-viewport related bounds. Add your control nodes as a child of a CanvasLayer for them to behave relative to the viewport