FCanvasTextItemBase

Base item used for drawing text

Inheritance Hierarchy

References

Module

Engine

Header

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

Include

#include "CanvasItem.h"

Syntax

class FCanvasTextItemBase : public FCanvasItem

Remarks

Base item used for drawing text

Variables

Name Description

Protected variable

FBatchedElement...

 

BatchedElements

These are used by the DrawStringInternal function. Used for batching.

Public variable

bool

 

bCentreX

Centre the text in the viewport on horizontally.

Public variable

bool

 

bCentreY

Centre the text in the viewport on vertically.

Public variable

bool

 

bDontCorrectStereoscopic

Disables correction of font render issue when using stereoscopic display.

Public variable

bool

 

bOutlined

Draw an outline on the text.

Public variable

float

 

Depth

Depth sort key.

Public variable

FVector2D

 

DrawnSize

The size of the drawn text after the draw call.

Public variable

FFontRenderInfo

 

FontRenderInfo

Custom font render information.

Public variable

float

 

HorizSpacingAdjust

Horizontal spacing adjustment.

Public variable

FLinearColor

 

OutlineColor

The color of the outline.

Public variable

FVector2D

 

Scale

The scale of the text

Public variable

FLinearColor

 

ShadowColor

The color of the shadow

Public variable

FVector2D

 

ShadowOffset

The offset of the shadow.

Protected variable

FCanvasTileItem

 

TileItem

Background tile used to fixup 3d text issues.

Constructors

Name Description

Public function

FCanvasTextItemBase

(
    const FVector2D& InPosition,
    const FLinearColor& InColor
)

Functions

Name Description

Public function

void

 

DisableShadow()

Disable the shadow

Protected function

void

 

DrawStringInternal

(
    FCanvas* InCanvas,
    const FVector2D& DrawPos,
    const FLinearColor& DrawColor,
    TArrayView< FTextEffect > Offsets
)

Internal string draw

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

Public function

void

 

EnableShadow

(
    const FLinearColor& InColor,
    const FVector2D& InOffset
)

Set the shadow offset and color.

Protected function Const

ESimpleEleme...

 

GetTextBlendMode

(
    const bool bHasShadow
)

Get the blend mode we should use to draw this text

Protected function Const

FVector2D

 

GetTextSize

(
    float DPIScale
)

Get the measured size of the text to draw

Protected function Const

bool

 

HasValidText()

Does this text item have valid text to draw?

Overridden from FCanvasItem

Name Description

Public function Virtual

void

 

Draw

(
    FCanvas* InCanvas
)

Draw the item at the given coordinates.

Public function Virtual

void

 

SetColor

(
    const FLinearColor& InColor
)

Set the Color of the item.

Classes

Name

Description

Protected struct

FTextEffect

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