RealDocs

UBorder::SetBrushFromMaterial

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

Description

Sets the border's background brush to render the given material instead of a texture.

Caveats & Gotchas

  • The material's Material Domain must be set to User Interface, or it will not render correctly on the brush.
  • Combine with GetDynamicMaterial afterwards if you need to animate the material's parameters at runtime.

Signature

UMG_API void SetBrushFromMaterial(UMaterialInterface* Material)

Parameters

Name Type Description Default
Material UMaterialInterface* Material to render as the border's background.

Return Type

void

Example

Apply a UI material background C++
void UMyUserWidget::ApplyPanelMaterial(UMaterialInterface* PanelMaterial)
{
    if (MyBorder && PanelMaterial)
    {
        MyBorder->SetBrushFromMaterial(PanelMaterial);
    }
}

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.