Let's say I have a VBoxContainer with a button and 4 labels in it. I want labels to be rotated so they are vertical, with their text going from bottom to top. Also, VBox height should follow the length of the longest label. How this can be done? (I'm using Godot 3.4.3)
Is it possible at all?
do you want break some necks?
do you tried in the VBox container Rect/Rotation set it to -90, and labels Align to Right?
@Zelta said: do you want break some necks?
do you tried in the VBox container Rect/Rotation set it to -90, and labels Align to Right?
This way doesn't work because I don't want the button to be rotated, only the labels.
but you can rotate the button too xD
@Zelta the button also has text which should be horizontal. Also, all this VBox is a part of bigger layout.
some like this? sorry if i dont understand what are you trying to do
@Zelta Yeah, exactly what I want! How did you make it? I see there is some symbol on VBoxContainer...
i used a 'Panel' node for layout but you can use any other Labels aligned to right VBox container Alignement set to 'End', rotation -90
the symbol is because the option 'children not selectable'
@Zelta, unfortunately this doesn't work because I need both Button and VBoxContainer with labels to be inside another container. And this outer container resets rotation of its children.
this way?
It really is as simple as @Zelta is showing, you likely just aren't yet familiar enough with godots UI/control nodes kit. I'd recommend you keep experimenting - it's actually a very capable system for UIs.
@Megalomaniak I'm not sure yet)
@Zelta Can you please elaborate on your last screenshot? How are button and labels laid out inside of Panel? It looks like what I need but I'm not sure that layout will work how I need.
Here is what I'm starting with:
Now I need labels to be vertical/rotated AND still participate in layout (i.e. height of the whole container should be equal to the length of the longest label):
But rotation of the labels are controlled by their containers and always reset to 0.
make sure your control nodes horizontal&vertical size flags are also set appropriately.
i used a panel, check the image. download the scene for ref
@Zelta Thanks for the scene. Unfortunately it doesn't work the way I need – container with labels is not a part of any other container so it doesn't affect layout/size of other elements (button, panel). Looks like it's simply impossible in Godot to include a rotated element inside of any container.
Hi, did you solve this? I am with a similar issue and I am working around it by using a Node2D as the parent of the label to be able to rotate it, then a Container as the parent of the Node2D. The Container will adapt to its parent, and with a Script I control de position of the childrens. This works but it is a bit tedious. So I'm looking for a solution to simplify it.
© 2022 - 2024 — McMap. All rights reserved.