RealDocs

UHorizontalBox

class UMG Blueprint Since 4.5
#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);

Version History

Introduced in: 4.5

Version Status Notes
5.6 stable

Feedback

Was this helpful?

Suggest an edit

Select a field above to begin editing.