Containers will automatically handle the transform (position, rotation, scale) of any nodes that are their direct children, at least that seems to be how it is based on my experience.
A way around this is to make a child node and then rotate that, so the parent will be transformed by the container but the child node will retain it's offset in rotation/position/etc. For example, if you have a setup like this:
- Container (HBoxContainer for example)
Then you could add a child node between the node you want to rotate and the container:
Then you should be able to rotate the NodeToRotate
node freely without any issues. I would recommend making the NodeToRotate_Holder
a Control node, so all it handles is the positioning of the node.
One major downside of this method though is that the rotated Label will NOT be taken into account when positioning and sizing other elements in the container, only the NodeToRotate_Holder
node will. This means that if you have your label rotated by 90 degrees and it's vertical size is greater than NodeToRotate_Holder
's size on the Y axis, it will not properly move the nodes around down and out of the way, the label will instead just display text over whatever may be underneath. The way around this is to dynamically resize NodeToRotate_Holder
so it's minimum size is always big enough to encapsulate the Label, but that can be tricky.