UHorizontalBox
Inherits: UObjectBase › UObjectBaseUtility › UObject › UVisual › UWidget › UPanelWidget › UHorizontalBox
#include "Components/HorizontalBox.h" Description
A layout panel that stacks child widgets left-to-right. Children resize according to their slot's fill rule.
Caveats & Gotchas
- • Fill and padding settings are on UHorizontalBoxSlot, not the panel. Retrieve the slot from AddChildToHorizontalBox().
- • Collapsed children are excluded from layout and take no space. Hidden children still hold their horizontal slot.
Example
Add two equal-width columns C++
auto AddFillSlot = [&](UWidget* Widget)
{
UHorizontalBoxSlot* Slot = MyHBox->AddChildToHorizontalBox(Widget);
if (Slot) Slot->SetSize(FSlateChildSize(ESlateSizeRule::Fill));
};
AddFillSlot(LeftWidget);
AddFillSlot(RightWidget); See Also
Version History
Introduced in: 4.5
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?