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. | Twitter

+3 votes

I have a box container with buttons as child nodes. The buttons are larger than the container so I tried scaling them down but the buttons do not respect the scale value. Is there a way to scale buttons inside a container?

in Engine by (274 points)

I've tried everything from buttonGroups to gridContainer. The base Container class is really nothing but a disguised control node. The problem is that the child nodes scale is linked to the parents scale. Try changing the child's scale will only result in it being overridden by the parents scale. the only way to change the scale of the child is to change the parent container scale which will then change all child node. That is a problem if you only want to change a single child node.

Unfortunately that was one of the first things I tried. The problem with that it only changes the size {width/height} of the node not its scale. That would be good if you have say a texture button/Frame you wanted to resize. But if that texture button had any children then they would not be resized causing a weird issue and trying to resize all child nodes is not practical when on the other hand they scale accordingly. I find that only the container nodes have this issue.

You may need need to set custom minimum size and try with the various size flags and values of controls.

I've had a lot of problems with scroll container because sets everything to minimum size and reset all resizes.

There is no current option to set a minimum scale size for nodes like you can do for its size property. That's the problem I have. My node has child nodes that need to be resized accordingly with the parent node. Just resizing the parent does nothing for the child nodes and trying to manually resize all child node proportionally to the parent is not practical. I can achieve this using every other node that's not apart of the container class. The reason I wanted to use one of the containers is that they have organizational properties build-in to help with child nodes. This lead me to believe the container class is fundamentally broken.

Actually You would need a Maximum property so that the node knows not to go over the set parameter since it will default to the parents scale.

Please log in or register to answer this question.

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.