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:


(the TextureFrame is that black frame)

asked Aug 2, 2017 in Engine by Voyga (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.

answered Aug 2, 2017 by YeOldeDM (1,308 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 How to use this Q&A? before posting your first questions.