RealDocs

UBorder::SetBrushFromTexture

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

Description

Sets the border's background brush to display the given 2D texture, keeping the brush's other settings unchanged.

Caveats & Gotchas

  • Only replaces the brush's image resource — tiling, draw mode, and tint from the existing Background brush are preserved.
  • The texture must stay referenced elsewhere (e.g. a hard reference or async load handle); otherwise it can be garbage collected while still assigned to the brush.

Signature

UMG_API void SetBrushFromTexture(UTexture2D* Texture)

Parameters

Name Type Description Default
Texture UTexture2D* Texture to use as the border's background image.

Return Type

void

Example

Swap the background texture C++
void UMyUserWidget::ApplyPanelTexture(UTexture2D* PanelTexture)
{
    if (MyBorder && PanelTexture)
    {
        MyBorder->SetBrushFromTexture(PanelTexture);
    }
}

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.