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?

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