0 votes

Is there a way to set the size of a TextureRect through code?
Please help.

Godot version 3.2.2
in Engine by (100 points)

i guess rect_size is not working, so i would go with rect_scale

1 Answer

+2 votes

You should be able to set its size with the function set_size, like this: $TextureRect.set_size(Vector2(100,50))

by (292 points)

Thanks again, MisterMano.
This works.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.