STextBlock

A simple static text widget

Windows
MacOS
Linux

Inheritance Hierarchy

References

Module

Slate

Header

/Engine/Source/Runtime/Slate/Public/Widgets/Text/STextBlock.h

Include

#include "Widgets/Text/STextBlock.h"

Syntax

class STextBlock : public SLeafWidget

Remarks

A simple static text widget

Constructors

Name Description

Public function

STextBlock()

Constructor

Destructors

Name Description

Public function

~STextBlock()

Destructor

Functions

Name Description

Public function

void

 

Construct

(
    const FArguments& InArgs
)

Construct this widget

Public function Const

const FText ...

 

GetText()

Gets the text assigned to this text block

Public function

void

 

SetAutoWrapText

(
    const TAttribute< bool >& InAutoWr...
)

See AutoWrapText attribute

Public function

void

 

SetColorAndOpacity

(
    const TAttribute< FSlateColor >& I...
)

See ColorAndOpacity attribute

Public function

void

 

SetFont

(
    const TAttribute< FSlateFontInfo > ...
)

Sets the font used to draw the text

Public function

void

 

SetHighlightText

(
    TAttribute< FText > InText
)

Sets the highlight text for this text block

Public function

void

 

SetJustification

(
    const TAttribute< ETextJustify::Typ...
)

See Justification attribute

Public function

void

 

SetLineHeightPercentage

(
    const TAttribute< float >& InLineH...
)

See LineHeightPercentage attribute

Public function

void

 

SetMargin

(
    const TAttribute< FMargin >& InMar...
)

See Margin attribute

Public function

void

 

SetMinDesiredWidth

(
    const TAttribute< float >& InMinDe...
)

See MinDesiredWidth attribute

Public function

void

 

SetShadowColorAndOpacity

(
    const TAttribute< FLinearColor >& ...
)

See ShadowColorAndOpacity attribute

Public function

void

 

SetShadowOffset

(
    const TAttribute< FVector2D >& InS...
)

See ShadowOffset attribute

Public function

void

 

SetStrikeBrush

(
    const TAttribute< const FSlateBrush...
)

Sets the brush used to strike through the text

Public function

void

 

SetText

(
    const TAttribute< FString >& InTex...
)

Sets the text for this text block

Public function

void

 

SetText

(
    const FString& InText
)

Sets the text for this text block

Public function

void

 

SetText

(
    const TAttribute< FText >& InText
)

Sets the text for this text block

Public function

void

 

SetText

(
    const FText& InText
)

Sets the text for this text block

Public function

void

 

SetTextFlowDirection

(
    const TOptional< ETextFlowDirection...
)

See TextFlowDirection attribute

Public function

void

 

SetTextShapingMethod

(
    const TOptional< ETextShapingMethod...
)

See TextShapingMethod attribute

Public function

void

 

SetTextStyle

(
    const FTextBlockStyle* InTextS...
)

See TextStyle argument

Public function

void

 

SetWrappingPolicy

(
    const TAttribute< ETextWrappingPoli...
)

Set WrappingPolicy attribute

Public function

void

 

SetWrapTextAt

(
    const TAttribute< float >& InWrapT...
)

See WrapTextAt attribute

Overridden from SWidget

Name Description

Public function Virtual Const

FVector2D

 

ComputeDesiredSize

(
    float
)

Overwritten from SWidget.

Protected function Virtual Const

bool

 

ComputeVolatility()

Recomputes the volatility of the widget.

Public function Virtual

TSharedRef< ...

 

CreateAccessibleWidget()

Public function Virtual Const

int32

 

OnPaint

(
    const FPaintArgs& Args,
    const FGeometry& AllottedGeometry,
    const FSlateRect& MyCullingRect,
    FSlateWindowElementList& OutDrawEl...,
    int32 LayerId,
    const FWidgetStyle& InWidgetStyle,
    bool bParentEnabled
)

Overwritten from SWidget.

Public function Virtual

void

 

SetDefaultAccessibleText

(
    EAccessibleType AccessibleType
)

Assign AccessibleText with a default value that can be used when AccessibleBehavior is set to Auto or Custom.

Classes

Name

Description

Public struct

FArguments

Select Skin
Light
Dark

Welcome to the new Unreal Engine 4 Documentation site!

We're working on lots of new features including a feedback system so you can tell us how we are doing. It's not quite ready for use in the wild yet, so head over to the Documentation Feedback forum to tell us about this page or call out any issues you are encountering in the meantime.

We'll be sure to let you know when the new system is up and running.

Post Feedback