The Godot Q&A is currently undergoing maintenance!

Your ability to ask and answer questions is temporarily disabled. You can browse existing threads in read-only mode.

We are working on bringing this community platform back to its full functionality, stay tuned for updates.

godotengine.org | Twitter

0 votes

I'm using following code to resize my TextureFrame:

var window_size = OS.get_window_size()

self.frame.set("rect/size", window_size)

this works when I'm enlarging my window, but it doesn't work when I'm trying to shrink the window, it goes like this:

1

(the TextureFrame is that black frame)

in Engine by (27 points)

1 Answer

0 votes

You should be able to use Anchors to allow your Control nodes to resize themselves to your viewport.
Take your top node Control and make sure its size fills the viewport; Edit > Expand to Parent (the root viewport is your top node's parent in this case). Find the Anchor button and set it to Full Rect.
Anchors are applied relative to their parent. So with the TextureFrame as a parent of the top node Control, you can do the same: Expand to parent and Anchor Full Rect.

by (1,328 points)
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 [email protected] with your username.