FCanvasTextItem

Text item with misc optional items such as shadow, centering etc.

Windows
MacOS
Linux

Inheritance Hierarchy

References

Module

Engine

Header

/Engine/Source/Runtime/Engine/Public/CanvasItem.h

Include

#include "CanvasItem.h"

Syntax

class FCanvasTextItem : public FCanvasTextItemBase

Remarks

Text item with misc optional items such as shadow, centering etc.

Variables

Name Description

Public variable

const UFont ...

 

Font

Font to draw text with.

Public variable

TOptional< FSla...

 

SlateFontInfo

Font info to draw the text with.

Public variable

FText

 

Text

The text to draw.

Constructors

Name Description

Public function

FCanvasTextItem

(
    const FVector2D& InPosition,
    const FText& InText,
    const UFont* InFont,
    const FLinearColor& InColor
)

Text item

Public function

FCanvasTextItem

(
    const FVector2D& InPosition,
    const FText& InText,
    const FSlateFontInfo& InFontInfo,
    const FLinearColor& InColor
)

Text item

Functions

Name Description

Protected function

void

 

DrawStringInternal_OfflineCache

(
    FCanvas* InCanvas,
    const FVector2D& DrawPos,
    const FLinearColor& DrawColor
)

Internal string draw

In a method to make it simpler to do effects like shadow, outline

Protected function

void

 

DrawStringInternal_RuntimeCache

(
    FCanvas* InCanvas,
    const FVector2D& DrawPos,
    const FLinearColor& DrawColor
)

Protected function Const

EFontCacheTy...

 

GetFontCacheType()

Get the type of font cache the UFont is using

Overridden from FCanvasTextItemBase

Name Description

Protected function Virtual

void

 

DrawStringInternal

(
    FCanvas* InCanvas,
    const FVector2D& DrawPos,
    const FLinearColor& DrawColor
)

Internal string draw

In a method to make it simpler to do effects like shadow, outline

Protected function Virtual Const

ESimpleEleme...

 

GetTextBlendMode

(
    const bool bHasShadow
)

Get the blend mode we should use to draw this text

Protected function Virtual Const

FVector2D

 

GetTextSize

(
    float DPIScale
)

Get the measured size of the text to draw

Protected function Virtual Const

bool

 

HasValidText()

Does this text item have valid text to draw?

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss