Godot Version
4
Question
I am new to Godot, so this may be an elementary question. I am trying to use an image menu, the menu is as such:
image(TextureRect)
button1
button2
button3
I have put all of this inside a Vbox. I have found a way to dynamically change the text size in the buttons based on screen size - but I cannot identify a method to change the image size.
The image is contained inside a TextureRect. I have been reading some advice, so I have added a minimum size to the textureRect. So when I run the game the textureRect is now displayed at that minimum size.
How can I scale the textureRect dynamically? I haven’t found any code I can apply, for example:
%TextureRectName.changeTheSizeTo.x = 100
%TextureRectName.scaleTheRectTo.x = 1 * .5
No matter what I do the image (TextureRect) stays the same minimum size. People keep saying to have it ‘fill’ - but If I alter the container sizing it just stretches the image, and it is not proportional.
Any advice? I don’t want to resort to having a number of different image sizes and swapping them based on the device size, that seems like an antiquated approach. Any advice would be helpful!