HBox container not displaying children next to each other
Asked Answered
G

2

0

Hello, I have a control scene with some labels, and i wanted to display two of them next to each other, so i tried to use a HBoxContainer node in another scene to display them that way but it seems like the HBoxContainer consider that the scene that i instantiate as children have no width and display one on top of the other:

The control scene i created:

What happend within the HBox container:

Adjusting size/anchors of the containers seems to not fix the problem, i tried to override the separation constant of the HBoxContainer, which allow to see both nodes but is not really what i need (don't want to adjust this each time the contained control changes).

That's my first time doing ui in godot and playing with containers, so i'm probably missing something. Does anyone know what i am doing wrong ?

Glaucous answered 28/4, 2023 at 13:21 Comment(0)
A
0

Your problem is likely the bare control node at the root of your first scene. The control node does not handle layout or size of its children (because it is not a container node). As far as your second scene is concerned TileInfo is probably sized something like 1, 1.

Solution: Promote the panel container in the first scene to root.

Adaminah answered 28/4, 2023 at 13:55 Comment(0)
G
0

Adaminah Using the panel container as root node fixed the thing, ty 🙂.

Glaucous answered 28/4, 2023 at 14:20 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.