How do I resize a particle2D's visibility rect to match screen size?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Fupicat

I have a menu screen with a Particle2D node that creates stars in the background, but when I resize the window, the particle2D stays in place and doesn’t resize. I have tried passing the viewport’s rect to the particle2D’s visibility rect, but that did nothing. I tried to pass the window’s size to the particle2D’s scale, but it disappeared! What do I have to do?