UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
FSlateBrush Struct Reference

#include <SlateBrush.h>

+ Inheritance diagram for FSlateBrush:

Public Member Functions

SLATECORE_API FSlateBrush ()
 
virtual ~FSlateBrush ()
 
UE::Slate::FDeprecateVector2DResult GetImageSize () const
 
void SetImageSize (UE::Slate::FDeprecateVector2DParameter InImageSize)
 
const FMarginGetMargin () const
 
ESlateBrushTileType::Type GetTiling () const
 
ESlateBrushMirrorType::Type GetMirroring () const
 
ESlateBrushImageType::Type GetImageType () const
 
ESlateBrushDrawType::Type GetDrawType () const
 
const FName GetResourceName () const
 
class UObjectGetResourceObject () const
 
SLATECORE_API void SetResourceObject (class UObject *InResourceObject)
 
FLinearColor GetTint (const FWidgetStyle &InWidgetStyle) const
 
void UnlinkColors ()
 
bool HasUObject () const
 
bool IsDynamicallyLoaded () const
 
UE::Slate::FDeprecateBox2D GetUVRegion () const
 
void SetUVRegion (const FBox2d &InUVRegion)
 
void SetUVRegion (const FBox2f &InUVRegion)
 
bool operator== (const FSlateBrush &Other) const
 
bool operator!= (const FSlateBrush &Other) const
 
void AddReferencedObjects (FReferenceCollector &Collector, UObject *ReferencingObject=nullptr)
 
const FSlateResourceHandleGetRenderingResource (UE::Slate::FDeprecateVector2DParameter LocalSize, float DrawScale) const
 
SLATECORE_API const FSlateResourceHandleGetRenderingResource () const
 
bool IsSet () const
 

Static Public Member Functions

static SLATECORE_API const FString UTextureIdentifier ()
 

Public Attributes

FSlateColor TintColor
 
TEnumAsByte< enum ESlateBrushDrawType::TypeDrawAs
 
TEnumAsByte< enum ESlateBrushTileType::TypeTiling
 
TEnumAsByte< enum ESlateBrushMirrorType::TypeMirroring
 
TEnumAsByte< enum ESlateBrushImageType::TypeImageType
 
FDeprecateSlateVector2D ImageSize
 
FMargin Margin
 
FSlateBrushOutlineSettings OutlineSettings
 
FSlateResourceHandle ResourceHandle
 

Protected Member Functions

SLATECORE_API FORCENOINLINE FSlateBrush (ESlateBrushDrawType::Type InDrawType, const FName InResourceName, const FMargin &InMargin, ESlateBrushTileType::Type InTiling, ESlateBrushImageType::Type InImageType, const UE::Slate::FDeprecateVector2DParameter &InImageSize, const FLinearColor &InTint=FLinearColor::White, UObject *InObjectResource=nullptr, bool bInDynamicallyLoaded=false)
 
SLATECORE_API FORCENOINLINE FSlateBrush (ESlateBrushDrawType::Type InDrawType, const FName InResourceName, const FMargin &InMargin, ESlateBrushTileType::Type InTiling, ESlateBrushImageType::Type InImageType, const UE::Slate::FDeprecateVector2DParameter &InImageSize, const TSharedRef< FLinearColor > &InTint, UObject *InObjectResource=nullptr, bool bInDynamicallyLoaded=false)
 
SLATECORE_API FORCENOINLINE FSlateBrush (ESlateBrushDrawType::Type InDrawType, const FName InResourceName, const FMargin &InMargin, ESlateBrushTileType::Type InTiling, ESlateBrushImageType::Type InImageType, const UE::Slate::FDeprecateVector2DParameter &InImageSize, const FSlateColor &InTint, UObject *InObjectResource=nullptr, bool bInDynamicallyLoaded=false)
 

Protected Attributes

FBox2f UVRegion
 
uint8 bIsDynamicallyLoaded:1
 
uint8 bHasUObject_DEPRECATED:1
 
uint8 bIsSet: 1
 
FName ResourceName
 

Friends

class FSlateShaderResourceManager
 

Detailed Description

A brush which contains information about how to draw a Slate element

Examples
/work/Engine/Source/Runtime/UMG/Public/Components/Widget.h.

Constructor & Destructor Documentation

◆ FSlateBrush() [1/4]

FSlateBrush::FSlateBrush ( )

Default constructor.

◆ ~FSlateBrush()

virtual FSlateBrush::~FSlateBrush ( )
inlinevirtual

◆ FSlateBrush() [2/4]

FSlateBrush::FSlateBrush ( ESlateBrushDrawType::Type  InDrawType,
const FName  InResourceName,
const FMargin InMargin,
ESlateBrushTileType::Type  InTiling,
ESlateBrushImageType::Type  InImageType,
const UE::Slate::FDeprecateVector2DParameter InImageSize,
const FLinearColor InTint = FLinearColor::White,
UObject InObjectResource = nullptr,
bool  bInDynamicallyLoaded = false 
)
protected

This constructor is protected; use one of the deriving classes instead.

Parameters
InDrawTypeHow to draw the texture
InResourceNameThe name of the resource
InMarginMargin to use in border and box modes
InTilingTile horizontally/vertically or both? (only in image mode)
InImageTypeThe type of image
InTintTint to apply to the element.
InOutlineSettingsOptional Outline Border Settings for RoundedBox mode

◆ FSlateBrush() [3/4]

FSlateBrush::FSlateBrush ( ESlateBrushDrawType::Type  InDrawType,
const FName  InResourceName,
const FMargin InMargin,
ESlateBrushTileType::Type  InTiling,
ESlateBrushImageType::Type  InImageType,
const UE::Slate::FDeprecateVector2DParameter InImageSize,
const TSharedRef< FLinearColor > &  InTint,
UObject InObjectResource = nullptr,
bool  bInDynamicallyLoaded = false 
)
protected

◆ FSlateBrush() [4/4]

FSlateBrush::FSlateBrush ( ESlateBrushDrawType::Type  InDrawType,
const FName  InResourceName,
const FMargin InMargin,
ESlateBrushTileType::Type  InTiling,
ESlateBrushImageType::Type  InImageType,
const UE::Slate::FDeprecateVector2DParameter InImageSize,
const FSlateColor InTint,
UObject InObjectResource = nullptr,
bool  bInDynamicallyLoaded = false 
)
protected

Member Function Documentation

◆ AddReferencedObjects()

void FSlateBrush::AddReferencedObjects ( FReferenceCollector Collector,
UObject ReferencingObject = nullptr 
)
inline

Report any references to UObjects to the reference collector.

◆ GetDrawType()

ESlateBrushDrawType::Type FSlateBrush::GetDrawType ( ) const
inline

◆ GetImageSize()

UE::Slate::FDeprecateVector2DResult FSlateBrush::GetImageSize ( ) const
inline

◆ GetImageType()

ESlateBrushImageType::Type FSlateBrush::GetImageType ( ) const
inline

◆ GetMargin()

const FMargin & FSlateBrush::GetMargin ( ) const
inline

◆ GetMirroring()

ESlateBrushMirrorType::Type FSlateBrush::GetMirroring ( ) const
inline

◆ GetRenderingResource() [1/2]

const FSlateResourceHandle & FSlateBrush::GetRenderingResource ( ) const

◆ GetRenderingResource() [2/2]

const FSlateResourceHandle & FSlateBrush::GetRenderingResource ( UE::Slate::FDeprecateVector2DParameter  LocalSize,
float  DrawScale 
) const
inline

◆ GetResourceName()

const FName FSlateBrush::GetResourceName ( ) const
inline

Gets the name of the resource object, if any.

Returns
Resource name, or NAME_None if the resource object is not set.

◆ GetResourceObject()

class UObject * FSlateBrush::GetResourceObject ( ) const
inline

Gets the UObject that represents the brush resource, if any.

The object may be a UMaterialInterface or a UTexture.

Returns
The resource object, or nullptr if it is not set.

◆ GetTiling()

ESlateBrushTileType::Type FSlateBrush::GetTiling ( ) const
inline

◆ GetTint()

FLinearColor FSlateBrush::GetTint ( const FWidgetStyle InWidgetStyle) const
inline

Gets the brush's tint color.

Parameters
InWidgetStyleThe widget style to get the tint for.
Returns
Tint color.

◆ GetUVRegion()

UE::Slate::FDeprecateBox2D FSlateBrush::GetUVRegion ( ) const
inline

Get brush UV region, should check if region is valid before using it

Returns
UV region

◆ HasUObject()

bool FSlateBrush::HasUObject ( ) const
inline

Checks whether this brush has a UTexture object

Returns
true if it has a UTexture object, false otherwise.

◆ IsDynamicallyLoaded()

bool FSlateBrush::IsDynamicallyLoaded ( ) const
inline

Checks whether the brush resource is loaded dynamically.

Returns
true if loaded dynamically, false otherwise.

◆ IsSet()

bool FSlateBrush::IsSet ( ) const
inline

◆ operator!=()

bool FSlateBrush::operator!= ( const FSlateBrush Other) const
inline

Compares this brush with another for inequality.

Parameters
OtherThe other brush.
Returns
false if the two brushes are equal, true otherwise.

◆ operator==()

bool FSlateBrush::operator== ( const FSlateBrush Other) const
inline

Compares this brush with another for equality.

Parameters
OtherThe other brush.
Returns
true if the two brushes are equal, false otherwise.

◆ SetImageSize()

void FSlateBrush::SetImageSize ( UE::Slate::FDeprecateVector2DParameter  InImageSize)
inline

◆ SetResourceObject()

void FSlateBrush::SetResourceObject ( class UObject InResourceObject)

Sets the UObject that represents the brush resource.

◆ SetUVRegion() [1/2]

void FSlateBrush::SetUVRegion ( const FBox2d InUVRegion)
inline

Set brush UV region

Parameters
InUVRegionWhen valid - overrides UV region specified in resource proxy

◆ SetUVRegion() [2/2]

void FSlateBrush::SetUVRegion ( const FBox2f InUVRegion)
inline

◆ UnlinkColors()

void FSlateBrush::UnlinkColors ( )
inline

Unlinks all colors in this brush.

See also
FSlateColor::Unlink

◆ UTextureIdentifier()

const FString FSlateBrush::UTextureIdentifier ( )
static

Gets the identifier for UObject based texture paths.

Returns
Texture identifier string.

Friends And Related Symbol Documentation

◆ FSlateShaderResourceManager

Member Data Documentation

◆ bHasUObject_DEPRECATED

uint8 FSlateBrush::bHasUObject_DEPRECATED
protected

Whether or not the brush has a UTexture resource

◆ bIsDynamicallyLoaded

uint8 FSlateBrush::bIsDynamicallyLoaded
protected

Whether or not the brush path is a path to a UObject

◆ bIsSet

uint8 FSlateBrush::bIsSet
protected

This is true for all constructed brushes except for optional brushes

◆ DrawAs

How to draw the image

◆ ImageSize

FDeprecateSlateVector2D FSlateBrush::ImageSize

Size of the resource in Slate Units

◆ ImageType

TEnumAsByte<enum ESlateBrushImageType::Type> FSlateBrush::ImageType

The type of image

◆ Margin

FMargin FSlateBrush::Margin

The margin to use in Box and Border modes

◆ Mirroring

TEnumAsByte<enum ESlateBrushMirrorType::Type> FSlateBrush::Mirroring

How to mirror the image in Image mode. This is normally only used for dynamic image brushes where the source texture comes from a hardware device such as a web camera.

◆ OutlineSettings

FSlateBrushOutlineSettings FSlateBrush::OutlineSettings

How to draw the outline. Currently only used for RoundedBox type brushes.

◆ ResourceHandle

FSlateResourceHandle FSlateBrush::ResourceHandle
mutable

Rendering resource for this brush

◆ ResourceName

FName FSlateBrush::ResourceName
protected

The name of the rendering resource to use

◆ Tiling

How to tile the image in Image mode

◆ TintColor

FSlateColor FSlateBrush::TintColor

Tinting applied to the image.

◆ UVRegion

FBox2f FSlateBrush::UVRegion
protected

Optional UV region for an image When valid - overrides UV region specified in resource proxy


The documentation for this struct was generated from the following files: