How to use Node2Ds in a Control?

Godot Version

v4.3.stable.official [77dcf97d8]

Question

The Control family of nodes in Godot is useful for making a wide variety of controls. They have containers to automatically adjust the layout in a manner similar to how libraries like Qt handle it.

Unfortunately, for video games this is often not what you want. Because video games are all about graphic design, I often want to have graphical components in non-aligned places. I also want to incorporate sprites that can animate. And when I resize my component, I want the entire thing to scale up and down the way the scale tool would do it, not have the Control system recalculate the layout.

Is there a good way to include Node2D elements in a UI design? Or are there Control components that break the rules and let me put them anywhere? And just scale up and down proportionate to their parent instead of being re-laid out and breaking my design?

Hello, is this the kind of behavior you’re referring to?
help

In this case, you can simply use a Control node. For example, if your UI is composed of Control nodes and the desired node is currently inside a container, you can reparent that node into a standalone Control node whose default size matches its original dimensions. This approach lets the node scale, move, or animate without triggering the automatic layout recalculation, while still inheriting transformations from its parent. See the video.