UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
FSlateTextBlockLayout Class Reference

#include <SlateTextBlockLayout.h>

Classes

struct  FWidgetArgs
 
struct  FWidgetDesiredSizeArgs
 

Public Member Functions

SLATE_API FSlateTextBlockLayout (SWidget *InOwner, FTextBlockStyle InDefaultTextStyle, const TOptional< ETextShapingMethod > InTextShapingMethod, const TOptional< ETextFlowDirection > InTextFlowDirection, const FCreateSlateTextLayout &InCreateSlateTextLayout, TSharedRef< ITextLayoutMarshaller > InMarshaller, TSharedPtr< IBreakIterator > InLineBreakPolicy)
 
SLATE_API void ConditionallyUpdateTextStyle (const FTextBlockStyle &InTextStyle)
 
SLATE_API void ConditionallyUpdateTextStyle (const FTextBlockStyle::CompareParams &InNewStyleParams)
 
SLATE_API void UpdateTextStyle (const FTextBlockStyle &InTextStyle)
 
SLATE_API void UpdateTextStyle (const FTextBlockStyle::CompareParams &InNewStyleParams)
 
SLATE_API FVector2D ComputeDesiredSize (const FWidgetDesiredSizeArgs &InWidgetArgs, const float InScale)
 
SLATE_API FVector2D ComputeDesiredSize (const FWidgetDesiredSizeArgs &InWidgetArgs, const float InScale, const FTextBlockStyle &InTextStyle)
 
PRAGMA_DISABLE_DEPRECATION_WARNINGS SLATE_API FVector2D ComputeDesiredSize (const FWidgetArgs &InWidgetArgs, const float InScale, const FTextBlockStyle &InTextStyle)
 
PRAGMA_ENABLE_DEPRECATION_WARNINGS SLATE_API FVector2D GetDesiredSize () const
 
SLATE_API float GetLayoutScale () const
 
SLATE_API int32 OnPaint (const FPaintArgs &InPaintArgs, const FGeometry &InAllottedGeometry, const FSlateRect &InClippingRect, FSlateWindowElementList &OutDrawElements, int32 LayerId, const FWidgetStyle &InWidgetStyle, bool bParentEnabled)
 
SLATE_API void DirtyLayout ()
 
SLATE_API void DirtyContent ()
 
SLATE_API void OverrideTextStyle (const FTextBlockStyle &InTextStyle)
 
SLATE_API void SetTextShapingMethod (const TOptional< ETextShapingMethod > &InTextShapingMethod)
 
SLATE_API void SetTextFlowDirection (const TOptional< ETextFlowDirection > &InTextFlowDirection)
 
SLATE_API void SetTextOverflowPolicy (const TOptional< ETextOverflowPolicy > InTextOverflowPolicy)
 
SLATE_API void SetDebugSourceInfo (const TAttribute< FString > &InDebugSourceInfo)
 
SLATE_API FChildrenGetChildren ()
 
SLATE_API void ArrangeChildren (const FGeometry &AllottedGeometry, FArrangedChildren &ArrangedChildren) const
 

Detailed Description

Class to handle the cached layout of STextBlock/SRichTextBlock by proxying around a FTextLayout

Constructor & Destructor Documentation

◆ FSlateTextBlockLayout()

FSlateTextBlockLayout::FSlateTextBlockLayout ( SWidget InOwner,
FTextBlockStyle  InDefaultTextStyle,
const TOptional< ETextShapingMethod InTextShapingMethod,
const TOptional< ETextFlowDirection InTextFlowDirection,
const FCreateSlateTextLayout InCreateSlateTextLayout,
TSharedRef< ITextLayoutMarshaller InMarshaller,
TSharedPtr< IBreakIterator InLineBreakPolicy 
)

Constructor

Member Function Documentation

◆ ArrangeChildren()

void FSlateTextBlockLayout::ArrangeChildren ( const FGeometry AllottedGeometry,
FArrangedChildren ArrangedChildren 
) const

Arrange any child widgets in this layout

◆ ComputeDesiredSize() [1/3]

PRAGMA_DISABLE_DEPRECATION_WARNINGS FVector2D FSlateTextBlockLayout::ComputeDesiredSize ( const FWidgetArgs InWidgetArgs,
const float  InScale,
const FTextBlockStyle InTextStyle 
)

Get the computed desired size for this layout, updating the internal cache as required

◆ ComputeDesiredSize() [2/3]

FVector2D FSlateTextBlockLayout::ComputeDesiredSize ( const FWidgetDesiredSizeArgs InWidgetArgs,
const float  InScale 
)

Get the computed desired size for this layout, updating the internal cache as required

◆ ComputeDesiredSize() [3/3]

FVector2D FSlateTextBlockLayout::ComputeDesiredSize ( const FWidgetDesiredSizeArgs InWidgetArgs,
const float  InScale,
const FTextBlockStyle InTextStyle 
)

Get the computed desired size for this layout, updating the internal cache as required

◆ ConditionallyUpdateTextStyle() [1/2]

void FSlateTextBlockLayout::ConditionallyUpdateTextStyle ( const FTextBlockStyle InTextStyle)

Conditionally update the text style if needed

◆ ConditionallyUpdateTextStyle() [2/2]

void FSlateTextBlockLayout::ConditionallyUpdateTextStyle ( const FTextBlockStyle::CompareParams InNewStyleParams)

Conditionally update the text style if needed

◆ DirtyContent()

void FSlateTextBlockLayout::DirtyContent ( )

Force dirty the content due to an external change that can't be picked up automatically by this cache. Also force dirties the layout. Will cause the contained text to be re-parsed by the marshaller next frame.

◆ DirtyLayout()

void FSlateTextBlockLayout::DirtyLayout ( )

Force dirty the layout due to an external change that can't be picked up automatically by this cache

◆ GetChildren()

FChildren * FSlateTextBlockLayout::GetChildren ( )

Get the child widgets of this layout

◆ GetDesiredSize()

PRAGMA_ENABLE_DEPRECATION_WARNINGS FVector2D FSlateTextBlockLayout::GetDesiredSize ( ) const

Gets the last computed desired size.

◆ GetLayoutScale()

float FSlateTextBlockLayout::GetLayoutScale ( ) const

Get the TextLayout scale.

◆ OnPaint()

int32 FSlateTextBlockLayout::OnPaint ( const FPaintArgs InPaintArgs,
const FGeometry InAllottedGeometry,
const FSlateRect InClippingRect,
FSlateWindowElementList OutDrawElements,
int32  LayerId,
const FWidgetStyle InWidgetStyle,
bool  bParentEnabled 
)

Paint this layout, updating the internal cache as required

◆ OverrideTextStyle()

void FSlateTextBlockLayout::OverrideTextStyle ( const FTextBlockStyle InTextStyle)

Override the text style used and immediately update the text layout (if required). This can be used to override the text style after calling ComputeDesiredSize (eg, if you can only compute your text style in OnPaint) Please note that changing the size or font used by the text may causing clipping issues until the next call to ComputeDesiredSize

◆ SetDebugSourceInfo()

void FSlateTextBlockLayout::SetDebugSourceInfo ( const TAttribute< FString > &  InDebugSourceInfo)

Set the information used to help identify who owns this text layout in the case of an error

◆ SetTextFlowDirection()

void FSlateTextBlockLayout::SetTextFlowDirection ( const TOptional< ETextFlowDirection > &  InTextFlowDirection)

Set the text flow direction that the internal text layout should use

◆ SetTextOverflowPolicy()

void FSlateTextBlockLayout::SetTextOverflowPolicy ( const TOptional< ETextOverflowPolicy InTextOverflowPolicy)

Set the text overflow policy that the internal text layout should use

◆ SetTextShapingMethod()

void FSlateTextBlockLayout::SetTextShapingMethod ( const TOptional< ETextShapingMethod > &  InTextShapingMethod)

Set the text shaping method that the internal text layout should use

◆ UpdateTextStyle() [1/2]

void FSlateTextBlockLayout::UpdateTextStyle ( const FTextBlockStyle InTextStyle)

Update the text style.

◆ UpdateTextStyle() [2/2]

void FSlateTextBlockLayout::UpdateTextStyle ( const FTextBlockStyle::CompareParams InNewStyleParams)

Update the text style.


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