Navigation
API > API/Runtime > API/Runtime/Slate
A simple static text widget
| Name | STextBlock |
| Type | class |
| Header File | /Engine/Source/Runtime/Slate/Public/Widgets/Text/STextBlock.h |
| Include Path | #include "Widgets/Text/STextBlock.h" |
Syntax
class STextBlock : public SLeafWidget
Inheritance Hierarchy
- FSharedFromThisBase → TSharedFromThis → SWidget → SLeafWidget → STextBlock
- FSlateControlledConstruction → SWidget → SLeafWidget → STextBlock
Derived Classes
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
STextBlock() |
Constructor | Widgets/Text/STextBlock.h |
Destructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
~STextBlock() |
Destructor | Widgets/Text/STextBlock.h |
Structs
| Name | Remarks |
|---|---|
| FArguments |
Typedefs
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| PrivateParentType | SLeafWidget | Widgets/Text/STextBlock.h | |
| PrivateThisType | STextBlock | Widgets/Text/STextBlock.h | |
| Super | SLeafWidget | Widgets/Text/STextBlock.h | |
| ThisClass | STextBlock | Widgets/Text/STextBlock.h |
Variables
Public
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| bIsAttributeBoundTextBound | uint16 | Widgets/Text/STextBlock.h | ||
| bIsAttributeColorAndOpacitySet | uint16 | Widgets/Text/STextBlock.h | ||
| bIsAttributeFontSet | uint16 | Widgets/Text/STextBlock.h | ||
| bIsAttributeHighlightColorSet | uint16 | Widgets/Text/STextBlock.h | ||
| bIsAttributeHighlightShapeSet | uint16 | Widgets/Text/STextBlock.h | ||
| bIsAttributeShadowColorAndOpacitySet | uint16 | Widgets/Text/STextBlock.h | ||
| bIsAttributeShadowOffsetSet | uint16 | Widgets/Text/STextBlock.h | ||
| bIsAttributeStrikeBrushSet | uint16 | Widgets/Text/STextBlock.h | ||
| bIsAttributeTransformPolicySet | uint16 | Widgets/Text/STextBlock.h | ||
| bIsAttributeWrapTextAtSet | uint16 | Widgets/Text/STextBlock.h | ||
| bTextLayoutUpdateDesiredSize | uint16 | Widgets/Text/STextBlock.h | ||
| bTextLayoutUpdateTextStyle | uint16 | Widgets/Text/STextBlock.h | ||
| Union_Flags | uint16 | Widgets/Text/STextBlock.h |
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| ApplyLineHeightToBottomLine | TSlateAttribute< bool > | Whether to leave extra space below the last line due to line height. | Widgets/Text/STextBlock.h | |
| AutoWrapText | TSlateAttribute< bool > | True if we're wrapping text automatically based on the computed horizontal space for this widget | Widgets/Text/STextBlock.h | |
| BoundText | TSlateAttribute< FText > | The text displayed in this text block | Widgets/Text/STextBlock.h | |
| bSimpleTextMode | bool | Widgets/Text/STextBlock.h | ||
| CachedSimpleDesiredSize | TOptional< FVector2f > | If this is enabled, text shaping, wrapping, justification are disabled in favor of much faster text layout and measurement. | Widgets/Text/STextBlock.h | |
| ColorAndOpacity | TSlateAttribute< FSlateColor > | Text color and opacity | Widgets/Text/STextBlock.h | |
| Font | TSlateAttribute< FSlateFontInfo > | Sets the font used to draw the text | Widgets/Text/STextBlock.h | |
| HighlightColor | TSlateAttribute< FLinearColor > | The color used to highlight the specified text | Widgets/Text/STextBlock.h | |
| HighlightShape | TSlateAttribute< const FSlateBrush * > | The brush used to highlight the specified text | Widgets/Text/STextBlock.h | |
| HighlightText | TSlateAttribute< FText > | Highlight this text in the TextBlock | Widgets/Text/STextBlock.h | |
| Justification | TSlateAttribute< ETextJustify::Type > | The amount to scale each lines height by. | Widgets/Text/STextBlock.h | |
| LineHeightPercentage | TSlateAttribute< float > | How the text should be aligned with the margin. | Widgets/Text/STextBlock.h | |
| Margin | TSlateAttribute< FMargin > | The amount of blank space left around the edges of text area. | Widgets/Text/STextBlock.h | |
| MinDesiredWidth | TSlateAttribute< float > | Prevents the text block from being smaller than desired in certain cases (e.g. when it is empty) | Widgets/Text/STextBlock.h | |
| ShadowColorAndOpacity | TSlateAttribute< FLinearColor > | Shadow color and opacity | Widgets/Text/STextBlock.h | |
| ShadowOffset | TSlateAttribute< FVector2D > | Drop shadow offset in pixels | Widgets/Text/STextBlock.h | |
| STextBlock | union STextBlock | Flags used to check if the SlateAttribute is set. | Widgets/Text/STextBlock.h | |
| StrikeBrush | TSlateAttribute< const FSlateBrush * > | Sets the brush used to strike through the text | Widgets/Text/STextBlock.h | |
| TextLayoutCache | TUniquePtr< FSlateTextBlockLayout > | The wrapped layout for this text block | Widgets/Text/STextBlock.h | |
| TextStyle | FTextBlockStyle | Default style used by the TextLayout | Widgets/Text/STextBlock.h | |
| TransformPolicy | TSlateAttribute< ETextTransformPolicy > | The transform policy we're using | Widgets/Text/STextBlock.h | |
| WrappingPolicy | TSlateAttribute< ETextWrappingPolicy > | The wrapping policy we're using | Widgets/Text/STextBlock.h | |
| WrapTextAt | TSlateAttribute< float > | Whether text wraps onto a new line when it's length exceeds this width; if this value is zero or negative, no wrapping occurs. | Widgets/Text/STextBlock.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
void Construct
(
const FArguments& InArgs |
Construct this widget | Widgets/Text/STextBlock.h | |
FSlateColor GetColorAndOpacity() |
Gets the current foreground color | Widgets/Text/STextBlock.h | |
const FSlateColor & GetColorAndOpacityRef() |
Gets the current foreground color as ref | Widgets/Text/STextBlock.h | |
FSlateFontInfo GetFont() |
Gets the current font | Widgets/Text/STextBlock.h | |
const FSlateFontInfo & GetFontRef() |
Gets the current font as ref | Widgets/Text/STextBlock.h | |
FSlateColor GetHighlightColor() |
Gets the current highlight color | Widgets/Text/STextBlock.h | |
const FSlateBrush * GetHighlightShape() |
Gets the current highlight shape | Widgets/Text/STextBlock.h | |
FMargin GetMargin() |
Gets the current margin | Widgets/Text/STextBlock.h | |
float GetMinDesiredWidth() |
Gets the current min desired width | Widgets/Text/STextBlock.h | |
FLinearColor GetShadowColorAndOpacity() |
Gets the current shadow color and opacity | Widgets/Text/STextBlock.h | |
const FLinearColor & GetShadowColorAndOpacityRef() |
Gets the current shadow color and opacity as ref | Widgets/Text/STextBlock.h | |
FVector2f GetShadowOffset() |
Gets the current shadow offset | Widgets/Text/STextBlock.h | |
const FSlateBrush * GetStrikeBrush() |
Gets the current strike brush | Widgets/Text/STextBlock.h | |
const FText & GetText() |
Gets the text assigned to this text block | Widgets/Text/STextBlock.h | |
ETextTransformPolicy GetTransformPolicyImpl() |
Get TransformPolicy attribute | Widgets/Text/STextBlock.h | |
virtual int32 OnPaint
(
const FPaintArgs& Args, |
Widgets/Text/STextBlock.h | ||
void SetApplyLineHeightToBottomLine
(
TAttribute< bool > InApplyLineHeightToBottomLine |
See ApplyLineHeightToBottomLine attribute | Widgets/Text/STextBlock.h | |
void SetAutoWrapText
(
TAttribute< bool > InAutoWrapText |
See AutoWrapText attribute | Widgets/Text/STextBlock.h | |
void SetColorAndOpacity
(
TAttribute< FSlateColor > InColorAndOpacity |
See ColorAndOpacity attribute | Widgets/Text/STextBlock.h | |
void SetFont
(
TAttribute< FSlateFontInfo > InFont |
Sets the font used to draw the text | Widgets/Text/STextBlock.h | |
void SetHighlightColor
(
TAttribute< FLinearColor > InHighlightColor |
See HighlightColor attribute | Widgets/Text/STextBlock.h | |
void SetHighlightShape
(
TAttribute< const FSlateBrush* > InHighlightShape |
See HighlightShape attribute | Widgets/Text/STextBlock.h | |
void SetHighlightText
(
TAttribute< FText > InText |
Sets the highlight text for this text block | Widgets/Text/STextBlock.h | |
void SetJustification
(
TAttribute< ETextJustify::Type > InJustification |
See Justification attribute | Widgets/Text/STextBlock.h | |
void SetLineHeightPercentage
(
TAttribute< float > InLineHeightPercentage |
See LineHeightPercentage attribute | Widgets/Text/STextBlock.h | |
void SetMargin
(
TAttribute< FMargin > InMargin |
See Margin attribute | Widgets/Text/STextBlock.h | |
void SetMinDesiredWidth
(
TAttribute< float > InMinDesiredWidth |
See MinDesiredWidth attribute | Widgets/Text/STextBlock.h | |
void SetOverflowPolicy
(
TOptional< ETextOverflowPolicy > InOverflowPolicy |
Sets the overflow policy for this text block | Widgets/Text/STextBlock.h | |
void SetShadowColorAndOpacity
(
TAttribute< FLinearColor > InShadowColorAndOpacity |
See ShadowColorAndOpacity attribute | Widgets/Text/STextBlock.h | |
void SetShadowOffset
(
TAttribute< FVector2D > InShadowOffset |
See ShadowOffset attribute | Widgets/Text/STextBlock.h | |
void SetStrikeBrush
(
TAttribute< const FSlateBrush* > InStrikeBrush |
Sets the brush used to strike through the text | Widgets/Text/STextBlock.h | |
void SetText
(
TAttribute< FText > InText |
Sets the text for this text block | Widgets/Text/STextBlock.h | |
void SetTextFlowDirection
(
const TOptional< ETextFlowDirection >& InTextFlowDirection |
See TextFlowDirection attribute | Widgets/Text/STextBlock.h | |
void SetTextShapingMethod
(
const TOptional< ETextShapingMethod >& InTextShapingMethod |
See TextShapingMethod attribute | Widgets/Text/STextBlock.h | |
void SetTextStyle
(
const FTextBlockStyle* InTextStyle |
See TextStyle argument | Widgets/Text/STextBlock.h | |
void SetTransformPolicy
(
TAttribute< ETextTransformPolicy > InTransformPolicy |
Set TransformPolicy attribute | Widgets/Text/STextBlock.h | |
void SetWrappingPolicy
(
TAttribute< ETextWrappingPolicy > InWrappingPolicy |
Set WrappingPolicy attribute | Widgets/Text/STextBlock.h | |
void SetWrapTextAt
(
TAttribute< float > InWrapTextAt |
See WrapTextAt attribute | Widgets/Text/STextBlock.h |
Overridden from SWidget
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual FVector2D ComputeDesiredSize
(
float |
Widgets/Text/STextBlock.h | ||
virtual TSharedRef< FSlateAccessibleWidget > CreateAccessibleWidget() |
Widgets/Text/STextBlock.h | ||
virtual TOptional< FText > GetDefaultAccessibleText
(
EAccessibleType AccessibleType |
Widgets/Text/STextBlock.h |
Overridden from FSlateControlledConstruction
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual const FSlateWidgetClassData & GetWidgetClass() |
Widgets/Text/STextBlock.h |
Static
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
static const FSlateWidgetClassData & GetPrivateWidgetClass() |
Widgets/Text/STextBlock.h | ||
static SLATE_API void PrivateRegisterAttributes
(
FSlateAttributeInitializer& |
Widgets/Text/STextBlock.h | ||
static const FSlateWidgetClassData & StaticWidgetClass() |
Widgets/Text/STextBlock.h |