RealDocs

UBorder::SetPadding

function UMG Blueprint Since 4.0
#include "Components/Border.h"
Access: public Specifiers: UFUNCTIONBlueprintCallable

Description

Sets the padding between the border's edge and the content it contains.

Caveats & Gotchas

  • Padding is expressed in Slate units, not screen pixels, so its visual size scales with DPI.
  • Changing padding at runtime invalidates the widget's layout on the next tick, which can be costly if called every frame.

Signature

UMG_API void SetPadding(FMargin InPadding)

Parameters

Name Type Description Default
InPadding FMargin New padding to apply between the border's edge and the content it contains.

Return Type

void

Example

Set uniform padding C++
void UMyUserWidget::TightenBorder()
{
    if (MyBorder)
    {
        MyBorder->SetPadding(FMargin(4.f));
    }
}

Tags

Version History

Introduced in: 4.0

Version Status Notes
5.6 stable

Feedback

Was this helpful?

Suggest an edit

Select a field above to begin editing.