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

Hi,
I am new to Godot so I dont know if it is a Bug or if I do something wrong.

The Problem

Container Tree:
- root
-- HBoxContainer
--- Button1
--- Control
---- ButtonBuggy
--- Button2

As intended all the buttons get arranged under each other as close as possible. But the BuggyButton inside Control does not say how much space it needs and so the Control.size.y is automaticly set to 0.


MyProject/Why I need it

I wanted to create somekind of subview. I like the idea of containers (also i am used to it from Qt). Inside a subview, there is should be a Node2d (as Local Map or something that can be drawn) and some gui Elements which i would rather place with anchor and margin.
The main view should set the size of the subviews. So far i created the subview with a viewport and all gui elemtens. As root Element of the subview I used a Control. If I just play this scene everything is as I wished.
The problem is that these subviews overlap if I try to arrange them in my main view with BoxContainers.


Solution

Set the min size for the Control-Node.
I had expected that the ControlNode takes the size of the child into consideration. (as Qt does it).

Godot version Godot Engine v3.2.3
in Engine by (14 points)

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.