To make an `HBoxContainer` dynamically resize with its image contents in Godot 4.3, follow these steps:
## Core Setup
- **Parent with `ScrollContainer`**: Place your `HBoxContainer` inside a `ScrollContainer` to enable scrolling when content exceeds visible area. Set the scroll direction (horizontal/vertical) in the `ScrollContainer` properties[5].
- **Container Settings**:
- Enable `Expand` and set **Stretch Mode** to `Keep Aspect` on all child `TextureRect` nodes[2].
- Apply **Size Flags** (`Fill` and `Expand`) to each `TextureRect` to ensure proportional scaling[2][3].
## Dynamic Resizing
For automatic width adjustment when adding/removing images:
For wrapping behavior, replace `HBoxContainer` with an `HFlowContainer` (ensuring it's inside a fixed-size Control node). This automatically wraps overflowing items to new rows while scaling contents[2][4].