+6 votes

Hi,

Haven't found information about the meaning of Fill and Expand in controls for godot. Could anyone with more experience please explain what are they used too?

I have set a panel and a text label inside, have set the label size flag to expand expecting it to horizontally cover all panel but it does nothing. On the other hand it seems that Fill + Expand can be combined. I'm a bit lost here.

Could anyone help on this?

Cheers.

in Engine by (44 points)

1 Answer

+4 votes

Yes, those seem to be undocumented. After playing with them this is what I gathered:

  • expand: the node will take as much space as possible. If there are multiple nodes set to expand the available space will be divided equally among them.
  • fill: is mostly relevant if expand is on and it will stretch the bounds of the child node to fill the available space. With fill off and expand on, the node still takes the whole space available, but it's bounds aren't modified, the size of the node will be the minimum possible. So basically expand without fill seems to place the node in the center on the selected axis (horizontal, vertical)

Hope the image helps a bit, it's kind of difficult to explain :)

I couldn't attach the iamge, here's the link: http://imgur.com/a/xTa5y

by (34 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.
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.

Categories