i have a scene with a texture rect (whose texture is loaded time to time from pictures in a folder) and an "Expand" button.
I want it to have a pretty simple beahaviour:
1. if the picture dimension is bigger than the screen, i want it to scale it down to fit the screen
2. if the picture dimension is smaller and expand is pressed, i want the texture to be scaled up to fill the screen dimension
3. If the picture dimension is smaller and not expanded, the texture remain had the same dimension of the screen
4.I want the picture to always remain in the middle of the screen and to keep its aspect ratio.
Is there a way to do it with control nodes? ideally, the perfect code would control the
stretch_mode of the texture rect properties only.
I really cannot find a way to make it work easily