UBorder::SetHorizontalAlignment
#include "Components/Border.h"
Access: public
Specifiers: UFUNCTIONBlueprintCallable
Description
Sets how the border's content is aligned horizontally within the space allotted to it.
Caveats & Gotchas
- • Only has a visible effect if the border is given more space than its content actually needs, e.g. inside a fill slot or Size Box.
- • The direct HorizontalAlignment UPROPERTY is deprecated as of 5.1 in favor of this setter.
Signature
UMG_API void SetHorizontalAlignment(EHorizontalAlignment InHorizontalAlignment) Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| InHorizontalAlignment | EHorizontalAlignment | New horizontal alignment for the border's content. | — |
Return Type
void Example
Center content horizontally C++
void UMyUserWidget::CenterBorderContent()
{
if (MyBorder)
{
MyBorder->SetHorizontalAlignment(HAlign_Center);
}
} Tags
Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?